# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1112380 | vjudge1 | Baloni (COCI15_baloni) | C++17 | 2083 ms | 6584 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 main(){
int n;
cin>>n;
int say=0;
vector<int> a;
for(int i=0;i<n;i++){
int x;cin>>x;
a.push_back(x);
}
int mx=*max_element(a.begin(),a.end());
for(int i=0;a[i]!=-1;i){
say++;
int q=1;
for(int j=i+1;j<n;j++){
if(a[j]==mx-q){
q++;
a[j]=-1;
}
}
a[i]=-1;
i++;
}
cout<<say-1;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |