# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
59797 | model_code | Zalmoxis (BOI18_zalmoxis) | C++17 | 582 ms | 62464 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.
/* lightly tested */
#include <cmath>
#include <cassert>
#include <iostream>
#include <list>
#include <deque>
using namespace std;
int main(){
int n, k;
cin >> n >> k;
deque<int> st;
list<int> res;
list<list<int>::iterator> increasable;
int sum = 0;
for(int i = 0; i <= n; ++i){
int x;
if(i == n) x = 30;
else cin >> x, sum += (1<<x);
while(!st.empty() && st[0] < x){
res.push_back(st[0]);
increasable.push_back(--res.end());
++st[0];
while(st.size() > 1 && st[0] == st[1]){
st.pop_front();
++st[0]; } }
st.push_front(x);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |