Submission #398129

#TimeUsernameProblemLanguageResultExecution timeMemory
398129chirathnirodhaCrayfish scrivener (IOI12_scrivener)C++17
Compilation error
0 ms0 KiB
//Coded by Chirath Nirodha #define F first #define S second #define PB push_back #define MP make_pair #define P push #define I insert typedef long long ll; typedef long double ld; typedef unsigned long long ull; using namespace std; const ll mod=1e9+7; vector<string> s; vector<ll> seq; void Init(){ string x(0,' '); seq.PB(0); s.PB(x); } void TypeLetter(char L) { string x=s[seq[seq.size()-1]]; x.PB(L); seq.PB(s.size()); s.PB(x); } void UndoCommands(int U) { seq.PB(seq[seq.size()-1-U]); } char GetLetter(int P) { return s[seq[seq.size()-1]][P]; }

Compilation message (stderr)

scrivener.cpp:14:1: error: 'vector' does not name a type
   14 | vector<string> s;
      | ^~~~~~
scrivener.cpp:15:1: error: 'vector' does not name a type
   15 | vector<ll> seq;
      | ^~~~~~
scrivener.cpp: In function 'void Init()':
scrivener.cpp:17:3: error: 'string' was not declared in this scope
   17 |   string x(0,' ');
      |   ^~~~~~
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:18:3: error: 'seq' was not declared in this scope
   18 |   seq.PB(0);
      |   ^~~
scrivener.cpp:19:3: error: 's' was not declared in this scope
   19 |   s.PB(x);
      |   ^
scrivener.cpp:19:8: error: 'x' was not declared in this scope
   19 |   s.PB(x);
      |        ^
scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:22:3: error: 'string' was not declared in this scope
   22 |   string x=s[seq[seq.size()-1]];
      |   ^~~~~~
scrivener.cpp:22:3: note: 'std::string' is defined in header '<string>'; did you forget to '#include <string>'?
scrivener.cpp:23:3: error: 'x' was not declared in this scope
   23 |   x.PB(L);
      |   ^
scrivener.cpp:24:3: error: 'seq' was not declared in this scope
   24 |   seq.PB(s.size());
      |   ^~~
scrivener.cpp:24:10: error: 's' was not declared in this scope
   24 |   seq.PB(s.size());
      |          ^
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:28:3: error: 'seq' was not declared in this scope
   28 |   seq.PB(seq[seq.size()-1-U]);
      |   ^~~
scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:31:10: error: 's' was not declared in this scope
   31 |   return s[seq[seq.size()-1]][P];
      |          ^
scrivener.cpp:31:12: error: 'seq' was not declared in this scope
   31 |   return s[seq[seq.size()-1]][P];
      |            ^~~