#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];
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
4 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
5 ms |
812 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
5 ms |
812 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
127 ms |
13188 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
11 ms |
13188 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |