Submission #1063650

#TimeUsernameProblemLanguageResultExecution timeMemory
1063650vjudge1Baloni (COCI15_baloni)C++17
0 / 100
248 ms7504 KiB
#include <bits/stdc++.h> #define MAXN 1000000 using namespace std; void solve(){ int n; cin>>n; int xd[n]; map <int,int> lol; for (int i=0;i<n;i++){ cin>>xd[i]; lol[xd[i]]++; } int ans=0; for (int i=0;i<n;i++){ if(lol[xd[i]-1]>0) lol[xd[i]-1]--; else ans++; lol[xd[i]]--; } cout<<ans<<endl; } int main() { int t; t=1; while(t--){ solve(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...