제출 #425691

#제출 시각아이디문제언어결과실행 시간메모리
425691SOIVIEONE크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
컴파일 에러
0 ms0 KiB
#include <iostream> #include <vector> #include <string> #include <set> using namespace std; char last; string cur; vector<string> v; vector<pair<int, int> > logs; vector<int> who; void Init() {} bool oops = true; void TypeLetter(char L) { logs.push_back({1, L}); int oo = who.size(); who.push_back(oo); oops = true; } void UndoCommands(int U) { logs.push_back({2, U}); who.push_back(who.size() - U - 1); oops = true; } string ans = ""; char GetLetter(int P) { if(oops) { oops = false; int cur = who.size()-1; while(cur >= 0) { if(who[cur] == cur) { char lol = logs[cur].second; ans += lol; cur --; } else { cur = who[cur]; } } reverse(ans.begin(), ans.end()); } // cout << "ans = " << ans << "\n"; return ans[P]; }

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

scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:49:9: error: 'reverse' was not declared in this scope
   49 |         reverse(ans.begin(), ans.end());
      |         ^~~~~~~