제출 #759605

#제출 시각아이디문제언어결과실행 시간메모리
759605aykhn크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; string s; vector<pair<int, char>> calls; int x; string f(int i) { if (i < 0) return ""; if (calls[i].fi == 1) return f(i - 1) + calls[i].se; return f(i - 1 - calls[i].se); } void Init() { s = ""; } void TypeLetter(char L) { calls.pb(mpr(1, L)); } void UndoCommands(int U) { calls.pb(mpr(2, U)); } char GetLetter(int P) { x++; if (x == 1) { s = f(calls.size() - 1); } return s[P]; }

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

scrivener.cpp: In function 'std::string f(int)':
scrivener.cpp:11:18: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, char> >, std::pair<int, char> >::value_type' {aka 'struct std::pair<int, char>'} has no member named 'fi'
   11 |     if (calls[i].fi == 1) return f(i - 1) + calls[i].se;
      |                  ^~
scrivener.cpp:11:54: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, char> >, std::pair<int, char> >::value_type' {aka 'struct std::pair<int, char>'} has no member named 'se'
   11 |     if (calls[i].fi == 1) return f(i - 1) + calls[i].se;
      |                                                      ^~
scrivener.cpp:13:31: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, char> >, std::pair<int, char> >::value_type' {aka 'struct std::pair<int, char>'} has no member named 'se'
   13 |     return f(i - 1 - calls[i].se);
      |                               ^~
scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:23:11: error: 'class std::vector<std::pair<int, char> >' has no member named 'pb'
   23 |     calls.pb(mpr(1, L));
      |           ^~
scrivener.cpp:23:14: error: 'mpr' was not declared in this scope
   23 |     calls.pb(mpr(1, L));
      |              ^~~
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:28:11: error: 'class std::vector<std::pair<int, char> >' has no member named 'pb'
   28 |     calls.pb(mpr(2, U));
      |           ^~
scrivener.cpp:28:14: error: 'mpr' was not declared in this scope
   28 |     calls.pb(mpr(2, U));
      |              ^~~