# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
357892 | beepbeepsheep | Baloni (COCI15_baloni) | C++17 | 71 ms | 11884 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;
#define ll long long
const ll bignum=1e17;
const int inf= 2e9;
const int mod= 1e9+7;
ll arr[1000001];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
memset(arr,0,sizeof(arr));
ll n,ele,ans=0;
cin>>n;
for (int i=0;i<n;i++){
cin>>ele;
if (arr[ele]==0){
ans++;
arr[ele-1]++;
}
else{
arr[ele]--;
arr[ele-1]++;
}
}
cout<<ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |