제출 #425674

#제출 시각아이디문제언어결과실행 시간메모리
425674temurbek_khujaev크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
0 / 100
185 ms10180 KiB
#include <bits/stdc++.h>

using namespace std;

char ans;
#define N 1000005
int root[N];
#define prev kfldsj
#define next kdslgjdgfs
int prev[N];
int next[N];
char val[N];
int len[N];
int curr = 1;
int last = 0;
int next_node = 0;

void Init() {


}

void TypeLetter(char L) {
    curr++;
    root[curr] = next_node++;
    prev[root[curr]] = root[curr - 1];
    val[root[curr]] = L;
}

void UndoCommands(int U) {
    curr++;
    root[curr] = root[curr - U];
}

char GetLetter(int P) {
    int x = root[curr];
    while (len[x] > P ){
        x = prev[x];
    }
    return val[x];
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...