제출 #1351328

#제출 시각아이디문제언어결과실행 시간메모리
1351328mxhrvsInfinite Race (EGOI24_infiniterace2)C++20
29 / 100
111 ms19168 KiB
#include<bits/stdc++.h>
using namespace std;
signed main(){
    int n;
    cin >> n;
    int k;
    cin >> k;
    int x;
    set<int> s;
    map<int,int> mp;
    int ans = 0;
    for(int i = 1; i <= k; i ++){
        cin >> x;
        if(x > 0 and s.find(-x) != s.end()) s.erase(-x);
        else if (x > 0 and s.find(-x) == s.end() and mp[x] > ans) ans ++;
        mp[x] ++;
        s.insert(x);
    }
    cout << ans << "\n";
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...