Submission #31644

#TimeUsernameProblemLanguageResultExecution timeMemory
31644qwertyBaloni (COCI15_baloni)C++11
100 / 100
103 ms9988 KiB
#include <bits/stdc++.h> using namespace std; long long n, dd[1000005], cnt(0), a; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n; fill_n(dd, 1000005, 0); for (int i=1; i<=n; ++i) { cin >> a; dd[a]++; if (dd[a+1] > 0) dd[a+1]--; else cnt++; } cout << cnt; }
#Verdict Execution timeMemoryGrader output
Fetching results...