Submission #590008

#TimeUsernameProblemLanguageResultExecution timeMemory
5900080123xxBaloni (COCI15_baloni)C++14
0 / 100
53 ms7244 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] == 1){ freq[ar[i]+1]--; } else{ ans++; } freq[ar[i]]++; } cout << ans << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...