Submission #42995

#TimeUsernameProblemLanguageResultExecution timeMemory
42995Mouhanad_HafezBaloni (COCI15_baloni)C++11
0 / 100
237 ms604 KiB
#include <bits/stdc++.h> #define ll long long #define F first #define S second #define SI size() #define pb push_back using namespace std; const ll MAX=1000007; ll i,m,n,sum,a[MAX],ans; int main(){ cin>>n; for (i=0;i<n;i++){ ll x; cin>>x; if (a[x]==0){ ans++; a[x-1]++; } if (a[x]==1){ a[x]--; a[x-1]--; } } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...