Submission #194141

#TimeUsernameProblemLanguageResultExecution timeMemory
194141juanmartinez111Crayfish scrivener (IOI12_scrivener)C++14
Compilation error
0 ms0 KiB
using namespace std; char last; string pal; void Init() { } void TypeLetter(char L) { pal.push_back(L): last = L; } void UndoCommands(int U) { for(int i=0;i<U;i++)pal.pop_back(); } char GetLetter(int P) { return pal[P]; }

Compilation message (stderr)

scrivener.cpp:3:1: error: 'string' does not name a type; did you mean 'struct'?
 string pal;
 ^~~~~~
 struct
scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:8:3: error: 'pal' was not declared in this scope
   pal.push_back(L):
   ^~~
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:14:25: error: 'pal' was not declared in this scope
     for(int i=0;i<U;i++)pal.pop_back();
                         ^~~
scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:19:10: error: 'pal' was not declared in this scope
   return pal[P];
          ^~~