# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
546898 | Ahmed57 | Baloni (COCI15_baloni) | C++14 | 342 ms | 7320 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>
using namespace std;
int main(){
int n;
cin>>n;
int arr[n];
for(int i = 0;i<n;i++)cin>>arr[i];
map<int,int> mp;
int ans = 0;
for(int i = 0;i<n;i++){
if(mp[arr[i]]){
mp[arr[i]]--;
mp[arr[i]-1]++;
}else{
mp[arr[i]-1]++;
ans++;
}
}
cout<<ans<<"\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |