Submission #61884

# Submission time Handle Problem Language Result Execution time Memory
61884 2018-07-27T04:14:31 Z 노영훈(#1796) Zalmoxis (BOI18_zalmoxis) C++11
0 / 100
331 ms 38008 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MX=1000010, inf=2e9;

int n, k;
int A[MX];

void comp(vector<int> &V){
    int sz=V.size();
    while(sz>1 && V[sz-2]==V[sz-1]){
        V.pop_back(), V[sz-2]++, sz--;
    }
}

int main(){
    ios::sync_with_stdio(0); cin.tie(0);
    cin>>n>>k;
    assert(k==1);
    for(int i=1; i<=n; i++) cin>>A[i];
    vector<int> V;
    list<int> B;

    for(int i=1; i<=n; i++) B.push_back(A[i]);

    for(auto it=B.begin(); it!=B.end();){
        if(V.empty()) { V.push_back(*it); it++; continue; }
        if(V.back()<*it) { B.insert(it, V.back()); it--; continue; }
        V.push_back(*it);
        comp(V);
        it++;
    }
    if(V[0]==29) B.push_back(29);

    for(int x:B) cout<<x<<' ';

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 245 ms 37624 KB not a zalsequence
2 Incorrect 321 ms 37756 KB not a zalsequence
3 Incorrect 267 ms 37864 KB not a zalsequence
4 Incorrect 331 ms 37864 KB not a zalsequence
5 Incorrect 310 ms 38008 KB not a zalsequence
6 Incorrect 306 ms 38008 KB not a zalsequence
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 4 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 3 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 3 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 1 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 4 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 4 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 4 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 4 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 2 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 3 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 4 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 4 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Runtime error 3 ms 38008 KB Execution killed with signal 11 (could be triggered by violating memory limits)