# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1112460 | vjudge1 | Baloni (COCI15_baloni) | C++11 | 2079 ms | 3664 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>
#pragma GCC optimize("Ofast,inline,unroll-loops,fast-math")
int main()
{
int n,count = 0;
int max=0,index=0;
std::cin >> n;
std::vector<int> arr(n,0);
for(int &i:arr)
std::cin >> i;
std::queue<int> q;
while(arr.size()>0)
{
int balon=arr[0];
count++;
for(int i=0;i<arr.size();i++)
{
if(arr[i]==balon)
{
q.push(i);
balon--;
}
if(balon==0)
break;
}
int katsayi=0;
while(!q.empty())
{
int x = q.front();
q.pop();
arr.erase(arr.begin()+x-katsayi);
katsayi++;
}
}
std::cout << count;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |