Submission #398236

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