QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#584414#9182. Infinite Racechengning09090 0ms3712kbC++20438b2024-09-23 14:01:452024-09-23 14:01:45

Judging History

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

  • [2024-09-23 14:01:45]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:3712kb
  • [2024-09-23 14:01:45]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

const int N = 2e5 + 10;

int n, q, cnt[N], ans;

int main() {
    ios::sync_with_stdio(0), cin.tie(0);
    cin >> n >> q;
    while (q--) {
        int x; cin >> x;
        if (x < 0) {
            if (cnt[-x]) cnt[-x]--;
        } else cnt[x]++;
    }
    for (int i = 1; i < n; i++) cout << cnt[i] << ' ', ans = max(ans, cnt[i] - 1);
    cout << ans;
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3712kb

input:

2
1
1

output:

1 0

result:

wrong answer 1st lines differ - expected: '0', found: '1 0'

Subtask #2:

score: 0
Wrong Answer

Test #21:

score: 0
Wrong Answer
time: 0ms
memory: 3556kb

input:

2
2
1
1

output:

2 1

result:

wrong answer 1st lines differ - expected: '1', found: '2 1'

Subtask #3:

score: 0
Wrong Answer

Test #45:

score: 0
Wrong Answer
time: 0ms
memory: 3580kb

input:

2
1
1

output:

1 0

result:

wrong answer 1st lines differ - expected: '0', found: '1 0'

Subtask #4:

score: 0
Skipped

Dependency #1:

0%