제출 #1232962

#제출 시각아이디문제언어결과실행 시간메모리
1232962clemmy14Crayfish scrivener (IOI12_scrivener)C++20
26 / 100
104 ms7208 KiB
#include<bits/stdc++.h> using namespace std; int first=0; string ans, texts; vector<int> parent; void Init() { } void TypeLetter(char L) { texts.push_back(L); // if(texts.size() == 0) { // string prev; prev.push_back(L); // texts.push_back(L); // } else { // string prev=texts[texts.size()-1]; prev.push_back(L); // texts.push_back(prev); // } parent.push_back(parent.size()-1); } void UndoCommands(int U) { texts.push_back(' '); parent.push_back(parent.size()-U-1); // string prev=texts[texts.size()-U-1]; // texts.push_back(prev); } char GetLetter(int P) { // cout << ans << endl; // cout << texts << endl; // for(auto x : parent) cout << x << ' '; // cout << endl; //return texts[texts.size()-1][P]; if(first == 0) { int id=texts.size()-1; while(id != -1) { if(texts[id] != ' ') ans.push_back(texts[id]); id=parent[id]; } reverse(ans.begin(), ans.end()); first++; } return ans[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...