제출 #115571

#제출 시각아이디문제언어결과실행 시간메모리
115571faustaadp크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
34 / 100
1079 ms17620 KiB
#include<bits/stdc++.h> typedef long long ll; #define pb push_back #define mp make_pair #define fi first #define se second using namespace std; char last; char hai[1010101]; pair<ll,ll> A[1010101]; ll te,pre[1010101]; void cek() { ll ii; for(ii=0;ii<te;ii++) cout<<ii<<" "<<char(A[ii].fi)<<" "<<A[ii].se<<"\n"; cout<<"\n"; } void Init() {} void TypeLetter(char L) { ll bes=0; if(te>0) bes=A[te-1].se+1; A[te]=mp(L,bes); hai[bes]=L; pre[te]=te-1; te++; // cek(); } void UndoCommands(int U) { A[te]=A[te-U-1]; pre[te]=pre[te-U-1]; te++; // cek(); } char GetLetter(int P) { ll ii; for(ii=te-1;;ii=pre[ii]) if(A[ii].se==P) return char(A[ii].fi); // return hai[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...