제출 #1209139

#제출 시각아이디문제언어결과실행 시간메모리
1209139LIA크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
5 / 100
7 ms1476 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef tuple<ll, ll, ll> plll; typedef vector<plll> vplll; typedef pair<ll, ll> pll; typedef vector<ll> vll; typedef vector<pll> vpll; typedef vector<vector<pll>> vvpll; typedef vector<vector<ll>> vvll; typedef vector<bool> vb; typedef vector<vector<bool>> vvb; #define loop(i, s, e) for (ll i = (s); i < (e); ++i) #define loopr(i, e, s) for (ll i = (e)-1; i >= (s); --i) #define all(a) a.begin(), a.end() const ll inf = 1e9 + 7; ll timer = 0; struct Node { char c; ll idx_of_par; }; vector<Node> tr; void Init() { Node nd= {'%', timer++}; tr.push_back(nd); } void TypeLetter(char l) { Node nd= {l, timer-1}; tr.push_back(nd); timer++; } void UndoCommands(int u) { ll idx = timer; tr[idx] = {'%', timer-u}; timer++; } char GetLetter(int p) { string s; auto t= timer-1; while (t!=0){ if (tr[t].c != '%') s+=tr[t].c; t = tr[t].idx_of_par; } reverse(all(s)); return s[p]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...