Submission #1128555

#TimeUsernameProblemLanguageResultExecution timeMemory
1128555Ak_16Infinite Race (EGOI24_infiniterace2)C++17
29 / 100
42 ms2632 KiB
#include <iostream> using namespace std; int main() { int n,q; int a[300000]; int cnt=0; cin>>n; cin>>q; int f[300000] = {0}; for(int i=1; i<=q; i++){cin>>a[i];} for(int i=1; i<=q; i++){ if(a[i]>0){ if(f[a[i]]==1){cnt++;} f[a[i]] = 1; } else {f[-a[i]] = 0;} } cout<<cnt; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...