Submission #417050

#TimeUsernameProblemLanguageResultExecution timeMemory
417050Emin2004Crayfish scrivener (IOI12_scrivener)C++14
34 / 100
1083 ms30180 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define pii pair<int, int> #define F first #define S second const int N = 1000005; const int mod = 1e9+7; struct P{ int type; char ch; int num; }; string s = ""; int m = 0, lastty = 0; P a[N]; string get(int idx){ if(idx < 0) return ""; if(a[idx].type == 1){ return get(idx - 1) + a[idx].ch; } else return get(idx - 1 - a[idx].num); } void Init() {} void TypeLetter(char L) { a[m].type = 1; a[m].num = 0; a[m].ch = L; m++; lastty = 1; } void UndoCommands(int U) { a[m].type = 2; a[m].num = U; a[m].ch = '1'; m++; lastty = 2; } char GetLetter(int P) { s = get(m - 1); lastty = 3; 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...