| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1233054 | dssfsuper2 | 크레이피쉬 글쓰는 기계 (IOI12_scrivener) | C++20 | 995 ms | 124440 KiB | 
#include <bits/stdc++.h>
using namespace std;
struct state{
  int curl;
  char curc;
  vector<int> bl;
};
vector<state> states;
state cs;
state null;
void Init() {
  
  cs.curl=-1;
  cs.curc=' ';
  cs.bl={};
  
  states.push_back(cs);
  for(int i = 0;i<20;i++){
    states.back().bl.push_back(0);
  }
}
void TypeLetter(char L) {
  state x;
  x.curl=cs.curl+1;
  x.curc=L;
  //to generate parents: first take previous, then take his first bl, then take the 2nd bl of his, etc
  //x.par=&states[states.size()-1];
  auto temp = states[states.size()-1];
  x.bl={(int)states.size()-1};
  for(int i = 0;i<19;i++){
    x.bl.push_back((temp.bl[i]));
    temp=states[temp.bl[i]];
  }
  states.push_back(x);
  cs=x;
}
void UndoCommands(int U) {
  state x;
  x.curl=states[states.size()-U-1].curl;
  x.curc=states[states.size()-U-1].curc;
  auto temp = states[states.size()-U-1];
  x.bl={(int)states.size()-U-1};
  for(int i = 0;i<19;i++){
    x.bl.push_back(temp.bl[i]);
    temp=states[temp.bl[i]];
  }
  states.push_back(x);
  cs=states.back();
}
char GetLetter(int P) {
 state* tmp= &cs;
 state* tmp2= &cs;
 if(cs.curl==P){
  return cs.curc;
 }
 for(int i = 19;i>=0;i--){
  tmp2=&states[tmp->bl[i]];
  if(tmp2->curl>P)tmp=&states[tmp->bl[i]];
  else if (tmp2->curl==P)return tmp2->curc;
 }
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
