# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
382934 | Iwanttobreakfree | Baloni (COCI15_baloni) | C++17 | 2081 ms | 1092 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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n,h,num;
cin>>n;
vector<int> v;
cin>>h;
v.push_back(h);
for(int i=1;i<n;i++){
cin>>num;
bool pos=false;
if(num<h){
for(int j=0;j<v.size();j++){
if(v[j]==num+1){
v[j]=num;
pos=true;
}
}
}
if(!pos){
v.push_back(num);
if(num>h)h=num;
}
}
cout<<v.size();
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |