Submission #1183080

#TimeUsernameProblemLanguageResultExecution timeMemory
1183080bogdiokBaloni (COCI15_baloni)C++20
100 / 100
105 ms3892 KiB
#include <bits/stdc++.h> using namespace std; int a[1000001],freq[1000001]; int main() { long long n , nr = 0; cin >> n; for (int i = 1; i <= n; ++ i) { cin >> a[i]; } for (int i = 1; i <= n; ++ i) { if (freq[a[i] + 1] > 0) { -- freq[a[i] + 1]; ++ freq[a[i]]; } else { ++nr; ++ freq[a[i]]; } } cout << nr; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...