QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#343259#8243. Contest AdvancementMayaZayn#WA 0ms3680kbC++141.5kb2024-03-02 12:12:512024-03-02 12:12:51

Judging History

你现在查看的是最新测评结果

  • [2024-03-02 12:12:51]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3680kb
  • [2024-03-02 12:12:51]
  • 提交

answer

#include <bits/stdc++.h>
#define MayaZayn ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define ll long long
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define all_r(x) (x).rbegin(), (x).rend()
#define mnEl(vec) *min_element(vec.begin(), vec.end())
#define mxEl(vec) *max_element(vec.begin(), vec.end())
#define yes cout << "YES"
#define no cout << "NO"
#define in(v) for (auto & x : v) cin >> x
#define out(v) for (auto & x : v) cout << x << ' '
#define inLL(v) for (ll & x : v) cin >> x
#define openIn(x) freopen(x, "r", stdin);
#define openOut(x) freopen(x, "w", stdout);
#define M 1000000007
#define N 10005

using namespace std;

void solve() {
    int n, k, c;
    cin >> n >> k >> c;
    int cur = 1, prev = -1, cnt = 1;
    for (int i = 0; i < n; ++i) {
        int t, s;
        cin >> t >> s;
        if (i) {
            if (prev == s) {
                if (cur == c) {
                    cur = 0;
                } else {
                    cur++;
                    if (cnt != k)
                        cout << t << endl, cnt++;
                }
            } else {
                cur = 1;
                if (cnt != k)
                    cout << t << endl, cnt++;
                prev = s;
            }
        } else {
            cout << t << endl;
            prev = s;
        }
    }
}

int main() {
    MayaZayn

//    int t;
//    cin >> t;
//    while (t--)
        solve();

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3604kb

input:

10 7 3
3 9
1 9
4 9
5 9
9 7
2 7
6 7
7 7
8 5
10 5

output:

3
1
4
9
2
6
8

result:

ok 7 lines

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3680kb

input:

10 5 2
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 2

output:

1
2
4
5
7

result:

wrong answer 3rd lines differ - expected: '3', found: '4'