Submission #31643

#TimeUsernameProblemLanguageResultExecution timeMemory
31643huyxooxooxooxooxBaloni (COCI15_baloni)C++14
100 / 100
269 ms9828 KiB
#include<iostream> #include<cstdio> #define ll long long #define maxN 1000005 #define endl '\n' using namespace std; ll n; ll a[maxN]; ll x; ll res; int main() { fill_n(&a[0],sizeof(a)/sizeof(a[0]),0); cin>>n; res=n; for(int i=0;i<n;i++) { cin>>x; a[x]++; if(a[x+1]>0) { res--; a[x+1]--; } } cout<<res; }
#Verdict Execution timeMemoryGrader output
Fetching results...