QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#737540 | #9182. Infinite Race | Octagons# | 0 | 101ms | 22556kb | C++20 | 594b | 2024-11-12 16:08:09 | 2024-11-12 16:08:10 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define sz(x) int32_t(x.size())
#define all(x) x.begin(),x.end()
#define pb push_back
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, q, ans = 0;
map<int, int> mp;
map<int, bool> mp2;
cin >> n >> q;
while (q--) {
int x;
cin >> x;
if (x > 0) {
if (mp2[x]) {
ans = max(ans, ++mp[x]);
} else {
mp[x] = 0;
}
mp2[x] = 1;
} else {
x = -x;
mp2[x] = mp[x] = 0;
}
}
cout << ans;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 29
Accepted
time: 0ms
memory: 3840kb
input:
2 1 1
output:
0
result:
ok single line: '0'
Test #2:
score: 29
Accepted
time: 0ms
memory: 3520kb
input:
2 2 1 -1
output:
0
result:
ok single line: '0'
Test #3:
score: 29
Accepted
time: 0ms
memory: 3616kb
input:
2 5 -1 -1 -1 -1 1
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Wrong Answer
time: 8ms
memory: 3812kb
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:
17
result:
wrong answer 1st lines differ - expected: '50154', found: '17'
Subtask #2:
score: 0
Wrong Answer
Test #21:
score: 34
Accepted
time: 0ms
memory: 3608kb
input:
2 2 1 1
output:
1
result:
ok single line: '1'
Test #22:
score: 34
Accepted
time: 7ms
memory: 3560kb
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: 3584kb
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: 3856kb
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: 101ms
memory: 22556kb
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: 3612kb
input:
200000 1 182487
output:
0
result:
ok single line: '0'
Test #27:
score: 0
Wrong Answer
time: 8ms
memory: 3496kb
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:
100056
result:
wrong answer 1st lines differ - expected: '133415', found: '100056'
Subtask #3:
score: 0
Wrong Answer
Test #45:
score: 22
Accepted
time: 0ms
memory: 3548kb
input:
2 1 1
output:
0
result:
ok single line: '0'
Test #46:
score: 22
Accepted
time: 0ms
memory: 3816kb
input:
2 2 1 -1
output:
0
result:
ok single line: '0'
Test #47:
score: 22
Accepted
time: 0ms
memory: 3472kb
input:
2 5 -1 -1 -1 -1 1
output:
0
result:
ok single line: '0'
Test #48:
score: 0
Wrong Answer
time: 0ms
memory: 3544kb
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:
6
result:
wrong answer 1st lines differ - expected: '16', found: '6'
Subtask #4:
score: 0
Skipped
Dependency #1:
0%