# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
677597 | Mariabf | Baloni (COCI15_baloni) | C++17 | 501 ms | 324 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;
vector<int>nums;
for(int i=0; i<n; i++){
int x;
cin>>x;
bool found=false;
for(int j=0; j<nums.size(); j++){
if(nums[j]==x+1){
nums[j]--;
found=true;
break;
}
}if(not found){
nums.push_back(x);
}
}cout<<nums.size();
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |