Submission #759624

#TimeUsernameProblemLanguageResultExecution timeMemory
759624aykhnCrayfish scrivener (IOI12_scrivener)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> // author: aykhn using namespace std; #define mpr make_pair #define pb push_back #define fi first #define se second int x; string s; vector<pair<int, char>> calls; 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) { int i = calls.size() - 1; while (i >= 0) { if (calls[i].fi == 2) { i -= calls[i].se; } else { s.pb(calls[i].se); } i--; } reverse(s.begin(), s.end()) } return s[P]; }

Compilation message (stderr)

scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:50:36: error: expected ';' before '}' token
   50 |         reverse(s.begin(), s.end())
      |                                    ^
      |                                    ;
   51 |     }
      |     ~