제출 #1193898

#제출 시각아이디문제언어결과실행 시간메모리
1193898veehjInfinite Race (EGOI24_infiniterace2)C++20
100 / 100
45 ms440 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define fi first #define se second #define pb push_back #define sz(a) (ll) a.size() #define all(x) (x).begin(), (x).end() #define rep(i, a, b) for(ll i=a; i<b; i++) #define rrep(i, a, b) for(ll i=a; i>=b; i--) #define vl vector<ll> #define vpll vector<pair<ll, ll>> #define vvl vector<vector<ll>> #define pll pair<ll, ll> ll n; vector<bool> curr; void f() { cin >> n; curr.assign(n, 0); ll q, ans=0; cin >> q; rep(i, 0, q){ ll x; cin >> x; if(x<0){ curr[-x]=0; } else { if(curr[x]==1){ ans++; curr.assign(n, 0); curr[x]=1; } else { curr[x]=1; } } } cout << ans; } int main() { int tc = 1; // cin >> tc; for (int i = 1; i <= tc; i++) { // cout << '#' << i << endl; f(); cout << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...