QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#581172 | #9182. Infinite Race | Bucketsmith | 29 | 9ms | 3772kb | C++20 | 421b | 2024-09-22 10:23:32 | 2024-09-22 10:23:32 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
bool b[N];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, q, ans = 0;
cin >> n >> q;
for(int i = 1, x; i <= q; i ++) {
cin >> x;
if(x > 0) {
if(!b[x]) b[x] = 1;
else ans ++;
}else{
b[-x] = 0;
}
}
cout << ans;
}
详细
Subtask #1:
score: 29
Accepted
Test #1:
score: 29
Accepted
time: 0ms
memory: 3520kb
input:
2 1 1
output:
0
result:
ok single line: '0'
Test #2:
score: 29
Accepted
time: 0ms
memory: 3576kb
input:
2 2 1 -1
output:
0
result:
ok single line: '0'
Test #3:
score: 29
Accepted
time: 0ms
memory: 3556kb
input:
2 5 -1 -1 -1 -1 1
output:
0
result:
ok single line: '0'
Test #4:
score: 29
Accepted
time: 7ms
memory: 3636kb
input:
2 200000 1 1 -1 -1 -1 1 -1 1 1 1 -1 -1 1 -1 1 1 -1 1 1 -1 -1 1 -1 -1 1 -1 1 -1 1 1 1 1 -1 1 -1 -1 -1 -1 -1 1 1 -1 -1 1 -1 -1 1 1 1 -1 -1 -1 -1 -1 1 -1 -1 1 1 1 -1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 1 -1 1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 1 1 1 1 1 1 -1 -1 -...
output:
50154
result:
ok single line: '50154'
Test #5:
score: 29
Accepted
time: 7ms
memory: 3580kb
input:
2 200000 1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 1 -1 1 1 1 -1 -1 1 -1 -1 -1 1 1 1 1 -1 1 1 1 -1 1 1 1 -1 1 1 1 -1 1 1 1 1 1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 1 -1 -1 1...
output:
50172
result:
ok single line: '50172'
Test #6:
score: 29
Accepted
time: 8ms
memory: 3692kb
input:
2 200000 1 1 1 1 1 1 1 1 -1 1 1 1 1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 1 1 -1 1 1 -1 1 -1 1 -1 1 -1 -1 1 1 1 1 1 -1 1 1 1 -1 -1 -1 1 -1 1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 1 1 1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 1 1 -1 1 1 1 1 -1 1 -1 -1 -1 1 1 1 -1 -1 1 1 -1 1 -1 -1 -1 1 ...
output:
49713
result:
ok single line: '49713'
Test #7:
score: 29
Accepted
time: 7ms
memory: 3576kb
input:
2 200000 1 -1 -1 1 -1 1 -1 1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 1 1 -1 1 1 -1 1 1 -1 1 -1 1 1 1 1 -1 -1 1 -1 -1 1 1 1 1 -1 -1 1 -1 -1 1 1 -1 1 -1 1 1 1 -1 -1 -1 -1 -1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 -1 -1 -1 -1 1 -1 -1 -1 1 1 1 -1 1 1 -1 1 1 1 -1 1 -1 -1 -1 1 1 -1 1 1 1 -1 1 1 1 1 1 -1 -1 1...
output:
49564
result:
ok single line: '49564'
Test #8:
score: 29
Accepted
time: 0ms
memory: 3632kb
input:
2 100 -1 1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 1 1 1 1 1 1 -1 -1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 1 1 -1 1 1 1 -1 1 -1 1 1 -1 1 -1 -1 -1 -1
output:
16
result:
ok single line: '16'
Test #9:
score: 29
Accepted
time: 0ms
memory: 3568kb
input:
2 2 1 1
output:
1
result:
ok single line: '1'
Test #10:
score: 29
Accepted
time: 6ms
memory: 3652kb
input:
2 200000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
199999
result:
ok single line: '199999'
Test #11:
score: 29
Accepted
time: 0ms
memory: 3692kb
input:
2 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
output:
99
result:
ok single line: '99'
Test #12:
score: 29
Accepted
time: 6ms
memory: 3700kb
input:
2 200000 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -...
output:
0
result:
ok single line: '0'
Test #13:
score: 29
Accepted
time: 0ms
memory: 3640kb
input:
2 100 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1
output:
0
result:
ok single line: '0'
Test #14:
score: 29
Accepted
time: 8ms
memory: 3616kb
input:
2 200000 1 1 1 1 1 1 1 1 1 -1 1 1 -1 -1 -1 1 1 1 -1 1 -1 1 -1 -1 -1 1 -1 1 1 -1 -1 -1 -1 1 1 1 -1 -1 1 -1 1 1 1 1 1 1 -1 1 -1 1 1 -1 -1 -1 1 1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 1 1 1 1 1 -1 1 -1 -1 -1 1 -1 1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 -1 1 1 1 -1 1 1 -1 -1 1 1 -1 -1 1 1 1...
output:
50402
result:
ok single line: '50402'
Test #15:
score: 29
Accepted
time: 0ms
memory: 3576kb
input:
2 100 1 1 1 -1 1 1 1 -1 -1 -1 -1 1 -1 1 1 1 -1 -1 1 1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 1 -1 -1 -1 1 1 1 1 1 1 -1 1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 1 1 -1 1 1 -1 -1 1 1 1 1 -1 -1 -1 1 1 1 1 1 -1 1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 1
output:
27
result:
ok single line: '27'
Test #16:
score: 29
Accepted
time: 8ms
memory: 3584kb
input:
2 200000 1 -1 1 -1 -1 -1 1 1 1 1 1 1 -1 -1 1 1 1 -1 1 1 1 -1 1 -1 1 1 1 1 -1 -1 1 -1 1 -1 -1 1 1 1 1 1 1 -1 -1 1 -1 1 -1 -1 1 -1 1 -1 1 1 -1 -1 1 -1 1 -1 1 1 -1 1 1 1 1 1 1 -1 -1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 -1 -1 1 1 1 -1 -1 1 -1 -1 -1 1 1 -1 1 -1 -1 -1 -1 1 1 -1 1 -1 1 -1 -1 -1 1 -1 -1 -1 1 1...
output:
49885
result:
ok single line: '49885'
Test #17:
score: 29
Accepted
time: 1ms
memory: 3636kb
input:
2 100 1 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 1 1 -1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 -1 1 -1 1 1 1 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
output:
84
result:
ok single line: '84'
Test #18:
score: 29
Accepted
time: 3ms
memory: 3572kb
input:
2 200000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
199987
result:
ok single line: '199987'
Test #19:
score: 29
Accepted
time: 0ms
memory: 3644kb
input:
2 4 1 1 1 1
output:
3
result:
ok single line: '3'
Test #20:
score: 29
Accepted
time: 0ms
memory: 3648kb
input:
2 5 1 -1 1 -1 -1
output:
0
result:
ok single line: '0'
Subtask #2:
score: 0
Wrong Answer
Test #21:
score: 34
Accepted
time: 0ms
memory: 3516kb
input:
2 2 1 1
output:
1
result:
ok single line: '1'
Test #22:
score: 34
Accepted
time: 6ms
memory: 3656kb
input:
2 200000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
199999
result:
ok single line: '199999'
Test #23:
score: 34
Accepted
time: 0ms
memory: 3704kb
input:
2 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
output:
99
result:
ok single line: '99'
Test #24:
score: 34
Accepted
time: 0ms
memory: 3696kb
input:
100 100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1
output:
1
result:
ok single line: '1'
Test #25:
score: 34
Accepted
time: 9ms
memory: 3772kb
input:
200000 200000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
1
result:
ok single line: '1'
Test #26:
score: 34
Accepted
time: 0ms
memory: 3560kb
input:
200000 1 182487
output:
0
result:
ok single line: '0'
Test #27:
score: 0
Wrong Answer
time: 6ms
memory: 3576kb
input:
3 200000 1 2 1 2 2 2 1 1 1 2 2 2 1 2 2 2 2 1 1 2 2 1 2 2 1 2 2 1 2 1 1 2 2 2 2 2 1 2 2 2 1 1 2 1 1 2 2 1 2 2 1 2 2 1 1 2 2 2 2 2 2 1 2 1 1 1 2 1 1 2 1 1 1 2 1 1 2 2 2 1 1 1 1 2 1 2 2 1 2 1 2 1 2 1 2 2 2 1 2 2 2 1 1 1 1 2 1 1 2 2 2 2 1 2 1 2 1 1 2 2 1 1 1 1 1 1 2 2 1 1 1 1 1 1 1 2 2 2 2 2 2 1 1 1 2 2...
output:
199998
result:
wrong answer 1st lines differ - expected: '133415', found: '199998'
Subtask #3:
score: 0
Wrong Answer
Test #45:
score: 22
Accepted
time: 0ms
memory: 3632kb
input:
2 1 1
output:
0
result:
ok single line: '0'
Test #46:
score: 22
Accepted
time: 0ms
memory: 3660kb
input:
2 2 1 -1
output:
0
result:
ok single line: '0'
Test #47:
score: 22
Accepted
time: 0ms
memory: 3632kb
input:
2 5 -1 -1 -1 -1 1
output:
0
result:
ok single line: '0'
Test #48:
score: 22
Accepted
time: 0ms
memory: 3632kb
input:
2 100 -1 1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 1 1 1 1 1 1 -1 -1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 1 1 -1 1 1 1 -1 1 -1 1 1 -1 1 -1 -1 -1 -1
output:
16
result:
ok single line: '16'
Test #49:
score: 22
Accepted
time: 0ms
memory: 3700kb
input:
2 2 1 1
output:
1
result:
ok single line: '1'
Test #50:
score: 22
Accepted
time: 0ms
memory: 3648kb
input:
2 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
output:
99
result:
ok single line: '99'
Test #51:
score: 22
Accepted
time: 0ms
memory: 3516kb
input:
2 100 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1
output:
0
result:
ok single line: '0'
Test #52:
score: 22
Accepted
time: 0ms
memory: 3580kb
input:
2 100 1 1 1 -1 1 1 1 -1 -1 -1 -1 1 -1 1 1 1 -1 -1 1 1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 1 -1 -1 -1 1 1 1 1 1 1 -1 1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 1 1 -1 1 1 -1 -1 1 1 1 1 -1 -1 -1 1 1 1 1 1 -1 1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 1
output:
27
result:
ok single line: '27'
Test #53:
score: 22
Accepted
time: 0ms
memory: 3628kb
input:
2 100 1 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 1 1 -1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 -1 1 -1 1 1 1 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
output:
84
result:
ok single line: '84'
Test #54:
score: 22
Accepted
time: 0ms
memory: 3572kb
input:
100 100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1
output:
1
result:
ok single line: '1'
Test #55:
score: 0
Wrong Answer
time: 0ms
memory: 3628kb
input:
100 100 92 24 44 6 56 47 78 13 79 24 86 40 7 40 3 33 1 63 9 82 73 40 4 92 88 1 9 77 24 27 22 74 55 26 49 99 64 28 20 49 62 11 78 10 69 76 93 96 18 65 20 2 91 4 81 61 41 29 18 3 93 6 31 7 91 58 78 46 56 69 92 46 96 36 22 84 4 8 62 64 61 38 91 2 87 46 27 63 35 55 10 7 74 60 73 45 83 94 40 70
output:
39
result:
wrong answer 1st lines differ - expected: '7', found: '39'
Subtask #4:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%