Submission #590011

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