Submission #1130624

#TimeUsernameProblemLanguageResultExecution timeMemory
1130624lopkusBaloni (COCI15_baloni)C++20
100 / 100
60 ms15176 KiB
#include <bits/stdc++.h> #define int long long using namespace std; const int N = 1e6 + 1; vector<int> cnt(N, 0); signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; vector<int> a(n + 1); int ans = n; for(int i = 1; i <= n; i++) { cin >> a[i]; if(cnt[a[i] + 1]) { cnt[a[i] + 1] -= 1; ans -= 1; } cnt[a[i]] += 1; } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...