# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1112390 | vjudge1 | Baloni (COCI15_baloni) | C++17 | 2059 ms | 7248 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>
#include <cstdint>
using namespace std;
#define int long long
int n,ok,sum=0,eksi,ilk=0;
int32_t main() {
cin>>n;
eksi=n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
while(eksi>0){
sum++;
ok=arr[ilk];
ilk=0;
for(int i=0;i<n;i++){
if(ok==arr[i]){
arr[i]=-1;
eksi--;
ok--;
}
else if(ilk==0 && ok!=arr[i]){
ilk=i;
}
}
}
cout<<sum;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |