Submission #194141

# Submission time Handle Problem Language Result Execution time Memory
194141 2020-01-15T20:18:12 Z juanmartinez111 Crayfish scrivener (IOI12_scrivener) C++14
Compilation error
0 ms 0 KB
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

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];
          ^~~