제출 #119831

#제출 시각아이디문제언어결과실행 시간메모리
119831dolphingarlic크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++14
0 / 100
87 ms6520 KiB
#include <bits/stdc++.h> using namespace std; pair<char, char> v[1000001]; char s[1000001]; int indx = 0, i = 0; bool got = false; void Init() { } void TypeLetter(char L) { v[indx++] = {'T', L}; } void UndoCommands(int U) { v[indx++] = {'U', (char)U}; } char GetLetter(int P) { if (!got) { int ptr = indx - 1; while (ptr != -1) { while (ptr != -1 && v[ptr].first == 'U') ptr -= v[ptr].second + 1; s[i++] = v[ptr--].second; } got = true; } return s[i - 1 - P]; } // int main() { // int t; // cin >> t; // for (int i = 0; i < t; i++) { // char c, d; int e; // cin >> c; // switch (c) { // case 'T': // cin >> d; // TypeLetter(d); // break; // case 'P': // cin >> e; // cout << GetLetter(e) << '\n'; // break; // default: // cin >> e; // UndoCommands(e); // } // } // }
#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...