# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
383291 | victoriad | Baloni (COCI15_baloni) | C++14 | 539 ms | 6636 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 <fstream>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <utility>
#include <queue>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin>>n;
vector<bool>p(n,false);
vector<int>b;
int x=0;
vector<int>a(n);
for(int i=0;i<n;i++){
cin>>a[i];
}
int y;
b.push_back(a[0]-1);
for(int i=1;i<n;i++){
if(p[i])continue;
for(int j=0;j<b.size();j++){
if(a[i]==b[j]){
b[j]--;
p[i]=true;
break;
}
}
if(!p[i])
b.push_back(a[i]-1);
}
cout<<b.size();
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |