Submission #42996

#TimeUsernameProblemLanguageResultExecution timeMemory
42996Mouhanad_HafezBaloni (COCI15_baloni)C++11
0 / 100
246 ms676 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]++; } else { a[x]--; a[x-1]--; } } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...