Submission #234540

#TimeUsernameProblemLanguageResultExecution timeMemory
234540crossing0ver크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int operations; char lastchar[1000005]; int P[1000005][20],sz[1000005]; void init() { } void TypeLetter(char L){ operations++; P[oprerations][0] = operations - 1; sz[operations] = sz[operations - 1] + 1; for (int i = 1; i < 20; i ++) P[operations][i] = P[ P[operations][i-1] ][i-1]; lastchar[operations] = L; } void UndoCommands(int U) { operations++; sz[operations] = sz[operations - 1 - U]; P[operations][0] = P[operations - 1 - U][0]; lastchar[operations]= lastchar[operations - 1 - U]; for (int i = 1; i < 20; i ++) P[operations][i] = P[ P[operations][i-1] ][i-1]; } char GetLetter(int P) { int x = sz[operations] - P - 1; int cur = operations; for (int i = 0; i < 20 ;i++) { if (x & i) { cur = P[cur][i]; } } return lastchar[cur]; }

Compilation message (stderr)

scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:13:4: error: 'oprerations' was not declared in this scope
  P[oprerations][0] = operations - 1;
    ^~~~~~~~~~~
scrivener.cpp:13:4: note: suggested alternative: 'operations'
  P[oprerations][0] = operations - 1;
    ^~~~~~~~~~~
    operations
scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:36:15: error: invalid types 'int[int]' for array subscript
    cur = P[cur][i];
               ^