#include <iostream>
using namespace std;
char last;
void Init() {}
string s[1000005];
char c[1000005],ad[1000005],ans[1000005];
long long int num[1000005],tmp;
long long int p,pp;
void TypeLetter(char L) {
p++;
if(p<=10000)
{
s[p]=s[p-1]+L;
}
c[p]='a';
ad[p]=L;
//cout<<s[p]<<endl;
}
void UndoCommands(int U) {
p++;
if(p<=10000)s[p]=s[p-U-1];
c[p]='b';
num[p]=U;
//cout<<s[p]<<endl;
}
char GetLetter(int P) {
if(p<=10000)return s[p][P];
if(tmp==0)
{
tmp=1;
for(int i=p;i>=1;i--)
{
if(c[i]=='a')
{
pp++;
ans[pp]=ad[i];
}
else
{
i-=num[i];
}
}
}
return ans[P];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
31616 KB |
Output is correct |
2 |
Correct |
18 ms |
31608 KB |
Output is correct |
3 |
Correct |
20 ms |
31616 KB |
Output is correct |
4 |
Correct |
24 ms |
31616 KB |
Output is correct |
5 |
Correct |
21 ms |
31616 KB |
Output is correct |
6 |
Correct |
19 ms |
31616 KB |
Output is correct |
7 |
Correct |
18 ms |
31616 KB |
Output is correct |
8 |
Correct |
21 ms |
31616 KB |
Output is correct |
9 |
Correct |
18 ms |
31616 KB |
Output is correct |
10 |
Correct |
20 ms |
31616 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
31616 KB |
Output is correct |
2 |
Correct |
19 ms |
31616 KB |
Output is correct |
3 |
Correct |
22 ms |
31616 KB |
Output is correct |
4 |
Correct |
19 ms |
31616 KB |
Output is correct |
5 |
Correct |
18 ms |
31688 KB |
Output is correct |
6 |
Correct |
24 ms |
31616 KB |
Output is correct |
7 |
Correct |
21 ms |
31616 KB |
Output is correct |
8 |
Correct |
19 ms |
31616 KB |
Output is correct |
9 |
Correct |
21 ms |
31616 KB |
Output is correct |
10 |
Correct |
19 ms |
31616 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
32640 KB |
Output is correct |
2 |
Correct |
19 ms |
32896 KB |
Output is correct |
3 |
Correct |
26 ms |
32640 KB |
Output is correct |
4 |
Correct |
24 ms |
32256 KB |
Output is correct |
5 |
Correct |
23 ms |
32896 KB |
Output is correct |
6 |
Correct |
29 ms |
34048 KB |
Output is correct |
7 |
Correct |
22 ms |
32512 KB |
Output is correct |
8 |
Correct |
24 ms |
35968 KB |
Output is correct |
9 |
Correct |
31 ms |
41600 KB |
Output is correct |
10 |
Correct |
21 ms |
33408 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
220 ms |
122856 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
250 ms |
122412 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |