#include<stdio.h>
#include<algorithm>
using namespace std;
int n, m;
char str[1000100];
int s[15010], e[15010], key;
int main() {
int i, j;
scanf("%d %d",&n,&m);
scanf("%s",str+1);
for (i=0;i<m;i++) {
char ch;
int a, b;
fflush(stdin);
scanf("%c",&ch);
if (ch=='a') {
scanf("%d %d",&s[key],&e[key]);
key++;
}
else {
scanf("%d",&a);
for (j=key-1;j>=0;j--) {
if (min(s[j],e[j])>a||max(s[j],e[j])<a) continue;
if (e[j]==a) a = s[j];
else if (e[j]>s[j]) a++;
else a--;
}
printf("%c\n",str[a]);
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
2172 KB |
lseek (syscall #8) was called by the program (disallowed syscall) |
2 |
Runtime error |
0 ms |
2172 KB |
lseek (syscall #8) was called by the program (disallowed syscall) |
3 |
Runtime error |
0 ms |
2172 KB |
lseek (syscall #8) was called by the program (disallowed syscall) |
4 |
Runtime error |
0 ms |
2172 KB |
lseek (syscall #8) was called by the program (disallowed syscall) |
5 |
Runtime error |
4 ms |
2172 KB |
lseek (syscall #8) was called by the program (disallowed syscall) |
6 |
Runtime error |
5 ms |
2172 KB |
lseek (syscall #8) was called by the program (disallowed syscall) |
7 |
Runtime error |
0 ms |
2172 KB |
lseek (syscall #8) was called by the program (disallowed syscall) |
8 |
Runtime error |
0 ms |
2172 KB |
lseek (syscall #8) was called by the program (disallowed syscall) |
9 |
Runtime error |
3 ms |
2172 KB |
lseek (syscall #8) was called by the program (disallowed syscall) |
10 |
Runtime error |
0 ms |
2172 KB |
lseek (syscall #8) was called by the program (disallowed syscall) |