Submission #590010

#TimeUsernameProblemLanguageResultExecution timeMemory
5900100123xxBaloni (COCI15_baloni)C++14
0 / 100
67 ms3700 KiB
#include <bits/stdc++.h> using namespace std; int n, ar[1000005], freq[1000005], ans; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; for (int i = 1; i<= n; i++){ cin >> ar[i]; if (freq[ar[i]+1] == 0){ freq[ar[i]+1]--; } else{ ans++; } freq[ar[i]]++; } cout << ans << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...