Submission #398135

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

Compilation message (stderr)

scrivener.cpp:3:1: error: 'string' does not name a type
    3 | string s[1000010];
      | ^~~~~~
scrivener.cpp: In function 'void Init()':
scrivener.cpp:6:3: error: 'string' was not declared in this scope
    6 |   string x;
      |   ^~~~~~
scrivener.cpp:8:3: error: 's' was not declared in this scope; did you mean 'ss'?
    8 |   s[0]=x;
      |   ^
      |   ss
scrivener.cpp:8:8: error: 'x' was not declared in this scope
    8 |   s[0]=x;
      |        ^
scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:12:3: error: 'string' was not declared in this scope
   12 |   string x=s[seq[seqs-1]];
      |   ^~~~~~
scrivener.cpp:13:3: error: 'x' was not declared in this scope
   13 |   x.push_back(L);
      |   ^
scrivener.cpp:14:13: error: 's' was not declared in this scope
   14 |   seq[seqs]=s.size();seqs++;
      |             ^
scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:21:10: error: 's' was not declared in this scope
   21 |   return s[seq[seqs-1]][P];
      |          ^