Submission #547120

#TimeUsernameProblemLanguageResultExecution timeMemory
547120oToToTCrayfish scrivener (IOI12_scrivener)C++17
Compilation error
0 ms0 KiB
#include <ext/rope> __gnu_cxx::crope a[1000001]; int cnt; void Init() { cnt = 0; } void TypeLetter(char c) { a[++cnt] = a[cnt] + c; } void UndoCommands(int k) { arr[++cnt]=arr[cnt-k-1]; } char GetLetter(int k){ return arr[cnt][k]; }

Compilation message (stderr)

scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:7:29: warning: operation on 'cnt' may be undefined [-Wsequence-point]
    7 | void TypeLetter(char c) { a[++cnt] = a[cnt] + c; }
      |                             ^~~~~
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:8:28: error: 'arr' was not declared in this scope
    8 | void UndoCommands(int k) { arr[++cnt]=arr[cnt-k-1]; }
      |                            ^~~
scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:9:31: error: 'arr' was not declared in this scope
    9 | char GetLetter(int k){ return arr[cnt][k]; }
      |                               ^~~