답안 #61834

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
61834 2018-07-26T19:14:20 Z theknife2001 크레이피쉬 글쓰는 기계 (IOI12_scrivener) C++17
0 / 100
127 ms 13188 KB
#include <bits/stdc++.h>

using namespace std;
const int N=1e6+5;
int a[N];
char b[N];
int c[N];
char s[N];
int cnt;
int k=-1;


void Init() {}

void TypeLetter(char L) {
    k++;
    a[k]=1;
    b[k]=L;
}

void UndoCommands(int U) {
    k++;
    a[k]=2;
    c[k]=U;
}

char GetLetter(int P) {
    if(cnt==0)
    {
        int j=0;
        while(k>=0)
        {
            if(a[k]==1)
            {
                s[j]=b[k];
                j++;
            }
            if(a[k]==2)
            {
                k=k-c[k];
            }
            else
            {
                cout<<k<<endl;
                assert(0);
            }
            k--;
        }
        reverse(s,s+j);
    }
    cnt=1;
    return s[P];
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 4 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 812 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 812 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 127 ms 13188 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 11 ms 13188 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -