이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N=1e6+5;
int a[N];
char b[N];
int c[N];
char s[N];
int cnt;
int k=-1;
void Init() {}
void TypeLetter(char L) {
k++;
a[k]=1;
b[k]=L;
}
void UndoCommands(int U) {
k++;
a[k]=2;
c[k]=U;
}
char GetLetter(int P) {
if(cnt==0)
{
int j=0;
while(k>=0)
{
if(a[k]==1)
{
s[j]=b[k];
j++;
}
if(a[k]==2)
{
k=k-c[k];
}
else
{
cout<<k<<endl;
assert(0);
}
k--;
}
reverse(s,s+j);
}
cnt=1;
return s[P];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |