| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1351329 | mxhrvs | Infinite Race (EGOI24_infiniterace2) | C++20 | 131 ms | 19948 KiB |
#include<bits/stdc++.h>
using namespace std;
signed main(){
int n;
cin >> n;
int k;
cin >> k;
int x[k+1];
set<int> s;
map<int,int> mp;
int ans = 0;
for(int i = 1; i <= k; i ++){
cin >> x[i];
if(x[i] > 0 and s.find(-x[i]) != s.end()) s.erase(-x[i]);
else if (x[i] > 0 and s.find(-x[i]) == s.end() and mp[x[i]] > ans and x[i] != x[i - 1]) ans ++;
else if (x[i] > 0 and s.find(-x[i]) == s.end() and mp[x[i]] >= ans and x[i] == x[i-1] ) ans ++;
mp[x[i]] ++;
s.insert(x[i]);
}
cout << ans << "\n";
}| # | 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... | ||||
