Submission #95295

#TimeUsernameProblemLanguageResultExecution timeMemory
95295karlopuhBaloni (COCI15_baloni)C++14
100 / 100
280 ms3832 KiB
#include <bits/stdc++.h> using namespace std; int n, x, ans, cnt[10000001]; int main(){ cin >> n; for(int i = 1; i <= n; i++){ cin >> x; if(cnt[x] == 0){ ans++; cnt[x - 1]++; }else{ cnt[x]--; cnt[x - 1]++; } }cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...