# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
382929 | Iwanttobreakfree | Baloni (COCI15_baloni) | C++17 | 346 ms | 10856 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;
cin>>n;
vector<pair<int,int> > v(n);
for(int i=0;i<n;i++){
cin>>v[i].first;
v[i].second=i;
}
sort(v.rbegin(),v.rend());
int cont=1;
for(int i=1;i<n;i++){
if(v[i].first==v[i-1].first-1&&v[i].second>v[i-1].second)continue;
else cont++;
}
cout<<cont<<'\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |