| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1362425 | avahw | Infinite Race (EGOI24_infiniterace2) | C++20 | 16 ms | 9800 KiB |
#include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
int n, q;
cin >> n >> q;
int res = 0;
unordered_set<int> ahead;
for(int i = 0; i < q; i++){
int e;
cin >> e;
if(e < 0){
e = abs(e);
if(ahead.find(e) != ahead.end()) ahead.erase(e);
}
else{
// e = abs(e);
if(ahead.find(e) != ahead.end()){
res++;
// cout << "lap after " << i << "\n";
ahead = {};
}
ahead.insert(e);
}
}
cout << res << "\n";
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
