Submission #1112383

#TimeUsernameProblemLanguageResultExecution timeMemory
1112383vjudge1Baloni (COCI15_baloni)C++17
100 / 100
120 ms7248 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { int n; cin >> n; vector<int> balon(n); unordered_map<int, int> ok; for (int i = 0; i < n; ++i) { cin >> balon[i]; } int atis = 0; for (int agirlik : balon) { if (ok[agirlik] > 0) { ok[agirlik]--; ok[agirlik - 1]++; } else { atis++; ok[agirlik - 1]++; } } cout << atis << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...