| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1355871 | yyc000123 | Infinite Race (EGOI24_infiniterace2) | C++20 | 64 ms | 9736 KiB |
#include<bits/stdc++.h>
using namespace std ;
const int N = 2e5+5 ;
const int Q = 2e5+5 ;
int n , q , x , ans ;
set<int> st ;
int main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0) ;
cin >> n >> q ;
while(q--){
cin >> x ;
if(x<0){
if(st.find(-x)!=st.end()) st.erase(-x) ;
}
else if(st.find(x)==st.end()){
st.insert(x) ;
}
else{
ans++ ;
st.clear() ;
st.insert(x) ;
}
}
cout << ans << '\n' ;
return 0 ;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
