제출 #1005251

#제출 시각아이디문제언어결과실행 시간메모리
1005251pawned크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
12 / 100
88 ms10508 KiB
#pragma GCC optimize("O1,O2,O3,Ofast,unroll-loops") #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; const int MAX = 5005; int moves = 1; vi cuts; // position to start adding letters string curr; void Init() { cuts.pb(0); } void print() { cout<<"cuts: "; for (int x : cuts) cout<<x<<" "; cout<<endl; cout<<"curr: "<<curr<<endl; } void TypeLetter(char L) { if ((int)(curr.size()) == cuts.back()) curr += L; else curr[cuts.back()] = L; cuts.pb(cuts.back() + 1); // print(); moves++; } void UndoCommands(int U) { cuts.pb(cuts[moves - U - 1]); // print(); moves++; } char GetLetter(int P) { return curr[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...