# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1063650 | vjudge1 | Baloni (COCI15_baloni) | C++17 | 248 ms | 7504 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |