Submission #960230

#TimeUsernameProblemLanguageResultExecution timeMemory
960230ezzzayBaloni (COCI15_baloni)C++14
40 / 100
53 ms5468 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define ff first #define ss second #define pb push_back const int N=3e5+5; int a[N]; bool vis[N]; signed main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } int p=0; map<int,int>mp; for(int i=1;i<=n;i++){ if(mp[a[i]+1]==0){ p++; mp[a[i]]++; } else{ mp[a[i]+1]--; mp[a[i]]++; } } cout<<p; }
#Verdict Execution timeMemoryGrader output
Fetching results...