제출 #759606

#제출 시각아이디문제언어결과실행 시간메모리
759606aykhn크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define mpr make_pair 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:12: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'
   12 |     if (calls[i].fi == 1) return f(i - 1) + calls[i].se;
      |                  ^~
scrivener.cpp:12: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'
   12 |     if (calls[i].fi == 1) return f(i - 1) + calls[i].se;
      |                                                      ^~
scrivener.cpp:14: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'
   14 |     return f(i - 1 - calls[i].se);
      |                               ^~
scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:24:11: error: 'class std::vector<std::pair<int, char> >' has no member named 'pb'
   24 |     calls.pb(mpr(1, L));
      |           ^~
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:29:11: error: 'class std::vector<std::pair<int, char> >' has no member named 'pb'
   29 |     calls.pb(mpr(2, U));
      |           ^~