# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
162698 | wjoao | Baloni (COCI15_baloni) | C++11 | 357 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>
#define maxn 1000100
using namespace std;
int mark[maxn], a, entrada[maxn], n;
int main(){
cin >> n;
int res = 0;
for(int i =0 ; i < n; i++){
cin >> entrada[i];
}
for(int i = n-1; i>= 0; i--){
int h = entrada[i];
if( mark[h-1] > 0 ){
mark[h-1]--;
}else{
res++;
}
mark[h]++;
}
cout << res << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |