Submission #1216290

#TimeUsernameProblemLanguageResultExecution timeMemory
1216290moondarksideCrayfish scrivener (IOI12_scrivener)C++20
Compilation error
0 ms0 KiB
std::vector<int> Instructions; std::vector<char> TiR; void Init(){ return; } void TypeLetter(char L){ Instructions.push_back(L); } void UndoCommands(int U){ Instructions.push_back(-U); } char GetLetter(int P){ if(TiR.size()==0){ for(int i=Instructions.size()-1;i>-1;i--){ if(Instructions[i]<0){ i+=Instructions[i]; } else{ TiR.push_back((char)Instructions[i]); } } } return TiR[TiR.size()-P-1]; }

Compilation message (stderr)

scrivener.cpp:1:6: error: 'vector' in namespace 'std' does not name a template type
    1 | std::vector<int> Instructions;
      |      ^~~~~~
scrivener.cpp:1:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
  +++ |+#include <vector>
    1 | std::vector<int> Instructions;
scrivener.cpp:2:6: error: 'vector' in namespace 'std' does not name a template type
    2 | std::vector<char> TiR;
      |      ^~~~~~
scrivener.cpp:2:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
    2 | std::vector<char> TiR;
      | ^~~
scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:9:5: error: 'Instructions' was not declared in this scope
    9 |     Instructions.push_back(L);
      |     ^~~~~~~~~~~~
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:13:5: error: 'Instructions' was not declared in this scope
   13 |     Instructions.push_back(-U);
      |     ^~~~~~~~~~~~
scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:17:8: error: 'TiR' was not declared in this scope
   17 |     if(TiR.size()==0){
      |        ^~~
scrivener.cpp:18:19: error: 'Instructions' was not declared in this scope
   18 |         for(int i=Instructions.size()-1;i>-1;i--){
      |                   ^~~~~~~~~~~~
scrivener.cpp:28:12: error: 'TiR' was not declared in this scope
   28 |     return TiR[TiR.size()-P-1];
      |            ^~~