# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1070330 | raduv | Infinite Race (EGOI24_infiniterace2) | C++14 | 97 ms | 10952 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
set <int> s;
int main()
{
int n, q, i, x, ans = 0;
cin >> n >> q;
while(q--){
cin >> x;
if(x < 0){
s.erase(-x);
}
else{
if(s.find(x) != s.end()){
ans++;
s.clear();
}
s.insert(x);
}
}
cout << ans << "\n";
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |