Submission #156130

#TimeUsernameProblemLanguageResultExecution timeMemory
156130mdn2002Baloni (COCI15_baloni)C++14
100 / 100
343 ms3840 KiB
#include<bits/stdc++.h> using namespace std; long long mod=1e9+7; int n,a[1000006],num[1000006],ans; int main() { cin>>n; for(int i=0;i<n;i++) { cin>>a[i]; if(num[a[i]+1]>0) { num[a[i]+1]--; } else ans++; num[a[i]]++; } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...