Submission #398132

#TimeUsernameProblemLanguageResultExecution timeMemory
398132chirathnirodhaCrayfish scrivener (IOI12_scrivener)C++17
Compilation error
0 ms0 KiB
//Coded by Chirath Nirodha
using namespace std;
vector<string> s;
vector<long long> seq;
void Init(){
  string x;
  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:3:1: error: 'vector' does not name a type
    3 | vector<string> s;
      | ^~~~~~
scrivener.cpp:4:1: error: 'vector' does not name a type
    4 | vector<long long> seq;
      | ^~~~~~
scrivener.cpp: In function 'void Init()':
scrivener.cpp:6:3: error: 'string' was not declared in this scope
    6 |   string x;
      |   ^~~~~~
scrivener.cpp:1:1: note: 'std::string' is defined in header '<string>'; did you forget to '#include <string>'?
  +++ |+#include <string>
    1 | //Coded by Chirath Nirodha
scrivener.cpp:7:3: error: 'seq' was not declared in this scope
    7 |   seq.push_back(0);
      |   ^~~
scrivener.cpp:8:3: error: 's' was not declared in this scope
    8 |   s.push_back(x);
      |   ^
scrivener.cpp:8:15: error: 'x' was not declared in this scope
    8 |   s.push_back(x);
      |               ^
scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:11:3: error: 'string' was not declared in this scope
   11 |   string x=s[seq[seq.size()-1]];
      |   ^~~~~~
scrivener.cpp:11:3: note: 'std::string' is defined in header '<string>'; did you forget to '#include <string>'?
scrivener.cpp:12:3: error: 'x' was not declared in this scope
   12 |   x.push_back(L);
      |   ^
scrivener.cpp:13:3: error: 'seq' was not declared in this scope
   13 |   seq.push_back(s.size());
      |   ^~~
scrivener.cpp:13:17: error: 's' was not declared in this scope
   13 |   seq.push_back(s.size());
      |                 ^
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:17:3: error: 'seq' was not declared in this scope
   17 |   seq.push_back(seq[seq.size()-1-U]);
      |   ^~~
scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:20:10: error: 's' was not declared in this scope
   20 |   return s[seq[seq.size()-1]][P];
      |          ^
scrivener.cpp:20:12: error: 'seq' was not declared in this scope
   20 |   return s[seq[seq.size()-1]][P];
      |            ^~~