제출 #482280

#제출 시각아이디문제언어결과실행 시간메모리
482280wnsduds1크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
컴파일 에러
0 ms0 KiB
#include<iostream> #include<vector> #include<algorithm> #include<set> #include<queue> #include<bitset> #include<string> #define SIZE 101 #define INF 987654321 #define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); using namespace std; int n; int idx; string s; string v; vector<string>str(n); vector<char>ret; void Init() { idx = 0; fastio; char s; cin >> n; while (n--) { cin >> s; if (s == 'T') { getchar(); char L; cin >> L; TypeLetter(L); } else if (s == 'U') { int u; cin >> u; UndoCommands(u); } else { int p; cin >> p; cout << GetLetter(p) << "\n"; } } } void TypeLetter(char L) { string v; v.push_back(L); if (idx == 0) str.push_back(v); else str.push_back(str[idx - 1] + v); idx += 1; } void UndoCommands(int U) { str.push_back(str[idx - (U + 1)]); idx += 1; } char GetLetter(int P) { return(str[idx - 1][P]); }

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

scrivener.cpp: In function 'void Init()':
scrivener.cpp:29:4: error: 'TypeLetter' was not declared in this scope
   29 |    TypeLetter(L);
      |    ^~~~~~~~~~
scrivener.cpp:34:4: error: 'UndoCommands' was not declared in this scope
   34 |    UndoCommands(u);
      |    ^~~~~~~~~~~~
scrivener.cpp:39:12: error: 'GetLetter' was not declared in this scope
   39 |    cout << GetLetter(p) << "\n";
      |            ^~~~~~~~~