Submission #975767

#TimeUsernameProblemLanguageResultExecution timeMemory
975767marinalucaCrayfish scrivener (IOI12_scrivener)C++14
Compilation error
0 ms0 KiB
char ans[1000010];
int a[1000010], rez[1000010], mat[20][1000010], t;
void Init(){}
void Typeletter (char L){
  int i;
    ans[a[++t] = t] = L;
    rez[t] = rez[mat[0][t] = v[t - 1]] + 1;
    for (i = 1; i < 20; ++ i)
        mat[i][t] = mat[i - 1][mat[i - 1][t]];
}
void UndoCommands(int U){v[++t] = v[t - U - 1];}

char GetLetter(int P){
    int a = v[t], i;
    for ( i = 20; i --;)
        if (rez[mat[i][a]] > P)
          a = mat[i][a];
    return ans[a];
}

Compilation message (stderr)

scrivener.cpp: In function 'void Typeletter(char)':
scrivener.cpp:7:30: error: 'v' was not declared in this scope
    7 |     rez[t] = rez[mat[0][t] = v[t - 1]] + 1;
      |                              ^
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:11:26: error: 'v' was not declared in this scope
   11 | void UndoCommands(int U){v[++t] = v[t - U - 1];}
      |                          ^
scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:14:13: error: 'v' was not declared in this scope
   14 |     int a = v[t], i;
      |             ^
scrivener.cpp:15:11: error: 'i' was not declared in this scope
   15 |     for ( i = 20; i --;)
      |           ^