Submission #506104

#TimeUsernameProblemLanguageResultExecution timeMemory
506104MurotYBaloni (COCI15_baloni)C++14
100 / 100
330 ms480 KiB
#include<bits/stdc++.h> #define ios ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define ll long long #define ff first #define ss second using namespace std; const int N=1e6+7; ll a[N]; int main() { ll n , ans=0; cin >> n; map <ll,ll> mp; for (int i=1;i<=n;i++){ int x; cin >> x; if (mp[x] == 0) ans++, mp[x-1]++; else mp[x]--, mp[x-1]++; } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...