QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#584400 | #9182. Infinite Race | appear | 34 | 40ms | 5956kb | C++14 | 468b | 2024-09-23 13:47:26 | 2024-09-23 13:47:27 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, q, a[N];
pair<int, int> id[N];
int main(){
cin >> n >> q;
for(int i = 1; i < n; i++) id[i] = {n, 0};
int ans = 0;
for(int i = 1, x; i <= q; i++){
cin >> x;
if(id[abs(x)].first == n && x < 0) continue;
if(id[abs(x)].first != n && id[abs(x)].first == x && id[abs(x)].second == ans) ans++;
id[abs(x)] = {x, ans};
}
cout << ans;
return 0;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 29
Accepted
time: 0ms
memory: 3620kb
input:
2 1 1
output:
0
result:
ok single line: '0'
Test #2:
score: 29
Accepted
time: 0ms
memory: 3632kb
input:
2 2 1 -1
output:
0
result:
ok single line: '0'
Test #3:
score: 29
Accepted
time: 0ms
memory: 3564kb
input:
2 5 -1 -1 -1 -1 1
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Wrong Answer
time: 22ms
memory: 3544kb
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:
99993
result:
wrong answer 1st lines differ - expected: '50154', found: '99993'
Subtask #2:
score: 34
Accepted
Test #21:
score: 34
Accepted
time: 0ms
memory: 3616kb
input:
2 2 1 1
output:
1
result:
ok single line: '1'
Test #22:
score: 34
Accepted
time: 14ms
memory: 3564kb
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: 3560kb
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: 3620kb
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: 32ms
memory: 5180kb
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: 1ms
memory: 5176kb
input:
200000 1 182487
output:
0
result:
ok single line: '0'
Test #27:
score: 34
Accepted
time: 18ms
memory: 3544kb
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:
133415
result:
ok single line: '133415'
Test #28:
score: 34
Accepted
time: 18ms
memory: 3544kb
input:
4 200000 3 2 1 3 2 2 2 1 1 1 2 3 3 2 1 1 1 3 1 1 3 3 1 1 3 1 2 2 1 2 1 3 2 2 2 2 1 3 1 1 2 2 3 1 1 3 1 3 1 3 3 2 1 2 3 1 1 1 3 2 1 3 2 2 2 3 1 3 2 3 2 2 3 1 1 3 1 2 2 1 2 1 1 1 1 2 2 1 2 2 1 2 2 1 2 2 3 2 3 2 3 1 3 2 3 2 1 3 3 2 3 3 2 3 3 3 3 3 3 2 3 2 2 1 3 2 3 2 3 2 1 1 2 2 3 2 3 1 1 2 3 2 3 3 2 2...
output:
105734
result:
ok single line: '105734'
Test #29:
score: 34
Accepted
time: 19ms
memory: 3704kb
input:
10 200000 3 4 4 8 3 7 3 6 4 2 8 5 3 6 8 6 9 2 7 5 5 4 4 1 9 3 5 5 1 5 2 1 2 8 2 1 8 5 9 1 3 5 7 4 5 2 8 8 8 5 4 2 8 9 7 3 3 1 8 8 3 5 6 4 2 3 9 5 9 1 3 9 6 8 1 7 4 8 9 2 5 5 8 4 4 3 1 3 4 4 7 2 8 2 8 9 3 9 4 7 1 3 5 2 3 7 2 7 3 6 5 3 1 3 1 4 7 8 7 6 6 5 4 2 9 6 8 1 1 4 5 1 8 3 1 7 6 7 1 3 8 6 2 4 4 ...
output:
57864
result:
ok single line: '57864'
Test #30:
score: 34
Accepted
time: 21ms
memory: 3704kb
input:
30 200000 18 9 9 18 3 26 1 17 16 14 17 29 13 1 18 27 19 17 29 2 27 27 4 15 15 16 24 12 19 13 17 23 15 5 25 10 26 23 19 17 22 17 3 15 12 2 5 24 7 20 25 25 25 13 13 18 7 8 27 3 23 8 9 11 27 7 12 4 11 9 4 15 20 26 8 22 9 20 20 20 24 19 25 5 12 27 28 11 16 14 16 20 16 28 6 29 1 16 24 11 19 18 21 9 2 14 ...
output:
31054
result:
ok single line: '31054'
Test #31:
score: 34
Accepted
time: 19ms
memory: 3680kb
input:
203 200000 100 186 4 75 56 130 181 36 161 3 191 32 73 58 164 195 30 33 131 124 53 99 135 140 1 124 29 89 16 34 161 152 54 188 65 43 181 28 83 169 160 47 44 59 145 195 79 27 176 18 179 144 11 195 36 85 169 90 146 93 73 66 11 155 133 63 90 108 107 90 137 65 143 120 154 94 86 202 122 17 56 71 84 179 11...
output:
11485
result:
ok single line: '11485'
Test #32:
score: 34
Accepted
time: 28ms
memory: 3664kb
input:
4000 200000 2985 3407 1143 3560 1007 1855 1639 590 2231 1529 1435 3586 1692 2369 3019 1377 331 3435 1266 2126 2560 3319 295 303 892 360 3487 2092 2712 3029 626 672 228 3846 493 3026 1981 1196 2227 1411 1463 3677 1658 714 630 860 3156 2080 2963 1977 2485 2147 2792 2299 371 1559 2848 2324 3115 851 347...
output:
2483
result:
ok single line: '2483'
Test #33:
score: 34
Accepted
time: 29ms
memory: 3976kb
input:
50000 200000 41213 30997 8619 41861 41316 30105 15006 5065 11015 16985 31909 37042 39467 40487 19883 28554 27460 15459 25824 13158 13066 35584 18001 12362 2818 25831 41729 38972 7193 37946 26803 47535 24225 38582 11225 18966 7044 30591 39076 47171 26818 48011 43377 14636 38329 19199 26087 4199 27793...
output:
708
result:
ok single line: '708'
Test #34:
score: 34
Accepted
time: 37ms
memory: 5956kb
input:
200000 200000 152734 110923 16496 149622 42618 139250 114608 26400 7774 14830 41079 28404 141560 75920 122036 159829 188426 1794 58069 67219 56319 87589 152026 49931 198814 121631 50352 35306 149116 96622 76915 32475 19261 145376 171230 135192 9951 12008 120134 56675 9658 365 164993 86997 101564 463...
output:
355
result:
ok single line: '355'
Test #35:
score: 34
Accepted
time: 40ms
memory: 5116kb
input:
200000 200000 27246 74011 14368 132003 132822 73717 178219 138282 64714 1226 87554 9175 85526 136668 35925 137518 192376 7331 5282 114513 109561 15792 123812 27275 103776 150744 63065 44068 41587 8571 164073 70684 31713 126280 129481 127543 74628 53503 157457 53412 48385 118805 190850 61145 759 6632...
output:
353
result:
ok single line: '353'
Test #36:
score: 34
Accepted
time: 33ms
memory: 5728kb
input:
200000 200000 38946 72672 90488 178872 198147 148517 21120 135564 141486 146690 158535 117398 53985 61630 32324 166488 191602 182605 17450 10007 44955 2832 164706 106964 73485 47865 180127 177432 153405 118096 34895 53548 1579 27202 181777 187006 169313 126798 137850 77449 194252 194736 143109 17519...
output:
371
result:
ok single line: '371'
Test #37:
score: 34
Accepted
time: 0ms
memory: 3504kb
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:
7
result:
ok single line: '7'
Test #38:
score: 34
Accepted
time: 0ms
memory: 3576kb
input:
100 100 26 26 11 16 83 11 16 16 11 26 11 16 11 16 26 16 11 16 99 16 11 26 26 11 16 27 26 11 16 11 11 11 11 16 26 92 16 16 11 26 16 11 26 16 16 26 16 16 11 11 26 16 26 11 11 26 1 11 2 11 11 11 11 16 16 16 26 11 11 80 16 26 16 26 26 11 11 26 16 35 26 26 26 38 11 11 11 16 16 16 26 16 20 11 26 26 16 26 ...
output:
46
result:
ok single line: '46'
Test #39:
score: 34
Accepted
time: 36ms
memory: 5176kb
input:
200000 200000 29665 27299 91359 91359 29665 91359 91359 91359 91359 29665 27299 27299 29665 23871 91359 91359 29665 91359 27299 27299 91359 29665 27299 37574 91359 29665 91359 52912 91359 27299 29665 27299 27299 27299 27299 29665 30652 91359 29665 29665 91359 29665 27299 81391 27299 91359 27299 2966...
output:
95191
result:
ok single line: '95191'
Test #40:
score: 34
Accepted
time: 0ms
memory: 3684kb
input:
100 100 66 66 8 8 45 45 97 97 58 58 34 34 71 71 20 69 69 54 54 53 53 43 43 88 88 34 34 76 76 74 74 62 62 42 42 50 50 89 89 66 66 44 44 56 56 96 96 33 33 15 20 15 24 24 12 12 64 64 46 46 21 21 15 15 92 99 99 68 41 87 87 64 64 17 17 73 73 58 44 66 58 92 92 68 68 51 49 49 52 6 49 52 7 7 71 71 50 50 95 95
output:
45
result:
ok single line: '45'
Test #41:
score: 34
Accepted
time: 39ms
memory: 5240kb
input:
200000 200000 48508 48508 192753 192753 128554 128554 9725 9725 81029 81029 24266 24266 94313 94313 153565 153565 64878 64878 24712 24712 50046 50046 196752 196752 140257 140257 72031 72031 180537 180537 68161 68161 30314 30314 179259 179259 162787 162787 11787 11787 21698 21698 179267 179267 154017...
output:
99995
result:
ok single line: '99995'
Test #42:
score: 34
Accepted
time: 0ms
memory: 3620kb
input:
2 4 1 1 1 1
output:
3
result:
ok single line: '3'
Test #43:
score: 34
Accepted
time: 1ms
memory: 5192kb
input:
200000 7 199999 199999 1 199999 55 199999 55
output:
3
result:
ok single line: '3'
Test #44:
score: 34
Accepted
time: 0ms
memory: 3500kb
input:
3 6 1 2 2 2 1 1
output:
3
result:
ok single line: '3'
Subtask #3:
score: 0
Wrong Answer
Test #45:
score: 22
Accepted
time: 0ms
memory: 3612kb
input:
2 1 1
output:
0
result:
ok single line: '0'
Test #46:
score: 22
Accepted
time: 0ms
memory: 3564kb
input:
2 2 1 -1
output:
0
result:
ok single line: '0'
Test #47:
score: 22
Accepted
time: 0ms
memory: 3704kb
input:
2 5 -1 -1 -1 -1 1
output:
0
result:
ok single line: '0'
Test #48:
score: 0
Wrong Answer
time: 0ms
memory: 3556kb
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:
49
result:
wrong answer 1st lines differ - expected: '16', found: '49'
Subtask #4:
score: 0
Skipped
Dependency #1:
0%