# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
95295 | karlopuh | Baloni (COCI15_baloni) | C++14 | 280 ms | 3832 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 n, x, ans, cnt[10000001];
int main(){
cin >> n;
for(int i = 1; i <= n; i++){
cin >> x;
if(cnt[x] == 0){
ans++;
cnt[x - 1]++;
}else{
cnt[x]--;
cnt[x - 1]++;
}
}cout << ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |