Submission #398130

#TimeUsernameProblemLanguageResultExecution timeMemory
398130chirathnirodhaCrayfish scrivener (IOI12_scrivener)C++17
Compilation error
0 ms0 KiB
//Coded by Chirath Nirodha
vector<string> s;
vector<long long> seq;
void Init(){
  string x(0,' ');
  seq.push_back(0);
  s.push_back(x);
}
void TypeLetter(char L) {
  string x=s[seq[seq.size()-1]];
  x.push_back(L);
  seq.push_back(s.size());
  s.push_back(x);
}
void UndoCommands(int U) {
  seq.push_back(seq[seq.size()-1-U]);
}
char GetLetter(int P) {
  return s[seq[seq.size()-1]][P];
}

Compilation message (stderr)

scrivener.cpp:2:1: error: 'vector' does not name a type
    2 | vector<string> s;
      | ^~~~~~
scrivener.cpp:3:1: error: 'vector' does not name a type
    3 | vector<long long> seq;
      | ^~~~~~
scrivener.cpp: In function 'void Init()':
scrivener.cpp:5:3: error: 'string' was not declared in this scope
    5 |   string x(0,' ');
      |   ^~~~~~
scrivener.cpp:6:3: error: 'seq' was not declared in this scope
    6 |   seq.push_back(0);
      |   ^~~
scrivener.cpp:7:3: error: 's' was not declared in this scope
    7 |   s.push_back(x);
      |   ^
scrivener.cpp:7:15: error: 'x' was not declared in this scope
    7 |   s.push_back(x);
      |               ^
scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:10:3: error: 'string' was not declared in this scope
   10 |   string x=s[seq[seq.size()-1]];
      |   ^~~~~~
scrivener.cpp:11:3: error: 'x' was not declared in this scope
   11 |   x.push_back(L);
      |   ^
scrivener.cpp:12:3: error: 'seq' was not declared in this scope
   12 |   seq.push_back(s.size());
      |   ^~~
scrivener.cpp:12:17: error: 's' was not declared in this scope
   12 |   seq.push_back(s.size());
      |                 ^
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:16:3: error: 'seq' was not declared in this scope
   16 |   seq.push_back(seq[seq.size()-1-U]);
      |   ^~~
scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:19:10: error: 's' was not declared in this scope
   19 |   return s[seq[seq.size()-1]][P];
      |          ^
scrivener.cpp:19:12: error: 'seq' was not declared in this scope
   19 |   return s[seq[seq.size()-1]][P];
      |            ^~~