제출 #398130

#제출 시각아이디문제언어결과실행 시간메모리
398130chirathnirodha크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
컴파일 에러
0 ms0 KiB
//Coded by Chirath Nirodha vector<string> s; vector<long long> seq; void Init(){ string x(0,' '); 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]; }

컴파일 시 표준 에러 (stderr) 메시지

scrivener.cpp:2:1: error: 'vector' does not name a type
    2 | vector<string> s;
      | ^~~~~~
scrivener.cpp:3:1: error: 'vector' does not name a type
    3 | vector<long long> seq;
      | ^~~~~~
scrivener.cpp: In function 'void Init()':
scrivener.cpp:5:3: error: 'string' was not declared in this scope
    5 |   string x(0,' ');
      |   ^~~~~~
scrivener.cpp:6:3: error: 'seq' was not declared in this scope
    6 |   seq.push_back(0);
      |   ^~~
scrivener.cpp:7:3: error: 's' was not declared in this scope
    7 |   s.push_back(x);
      |   ^
scrivener.cpp:7:15: error: 'x' was not declared in this scope
    7 |   s.push_back(x);
      |               ^
scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:10:3: error: 'string' was not declared in this scope
   10 |   string x=s[seq[seq.size()-1]];
      |   ^~~~~~
scrivener.cpp:11:3: error: 'x' was not declared in this scope
   11 |   x.push_back(L);
      |   ^
scrivener.cpp:12:3: error: 'seq' was not declared in this scope
   12 |   seq.push_back(s.size());
      |   ^~~
scrivener.cpp:12:17: error: 's' was not declared in this scope
   12 |   seq.push_back(s.size());
      |                 ^
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:16:3: error: 'seq' was not declared in this scope
   16 |   seq.push_back(seq[seq.size()-1-U]);
      |   ^~~
scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:19:10: error: 's' was not declared in this scope
   19 |   return s[seq[seq.size()-1]][P];
      |          ^
scrivener.cpp:19:12: error: 'seq' was not declared in this scope
   19 |   return s[seq[seq.size()-1]][P];
      |            ^~~