| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1338370 | poapaa. | Infinite Race (EGOI24_infiniterace2) | C++20 | 1094 ms | 1980 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, q, i, x;
int crossings;
cin >> n >> q;
vector<int> last_pos( n, 0 );
vector<int> current_lap( n, 0 );
crossings = 0;
for( i = 1; i <= q; i++ ) {
cin >> x;
if( x > 0 ) {
if( last_pos[x] == 1 ) {
crossings++;
for( int j = 1; j < n; j++ ) {
last_pos[j] = 0;
}
}
last_pos[x] = 1;
} else {
int p = -x;
last_pos[p] = -1;
}
}
cout << crossings << endl;
return 0;
}
| # | 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... | ||||
