11550 | 2024-10-26 14:14:24 | balint | Periodikus Szavak | python3 | Time limit exceeded 41/100 | 600ms | 3952 KiB |
def main():
input()
text = input().strip()
for _ in range(int(input())):
l, r = map(int, input().strip().split())
s = text[l:r+1]
print("YES" if s in (s+s)[1:-1] else "NO")
main()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 16ms | 2872 KiB | ||||
subtask2 | 14/14 | ||||||
2 | Accepted | 16ms | 2864 KiB | ||||
3 | Accepted | 16ms | 2876 KiB | ||||
4 | Accepted | 17ms | 3052 KiB | ||||
5 | Accepted | 16ms | 2872 KiB | ||||
6 | Accepted | 16ms | 3012 KiB | ||||
7 | Accepted | 16ms | 3064 KiB | ||||
8 | Accepted | 16ms | 3080 KiB | ||||
9 | Accepted | 16ms | 2872 KiB | ||||
10 | Accepted | 16ms | 2864 KiB | ||||
11 | Accepted | 16ms | 2972 KiB | ||||
12 | Accepted | 16ms | 3080 KiB | ||||
subtask3 | 27/27 | ||||||
13 | Accepted | 25ms | 3128 KiB | ||||
14 | Accepted | 23ms | 3128 KiB | ||||
15 | Accepted | 24ms | 3116 KiB | ||||
16 | Accepted | 17ms | 2880 KiB | ||||
17 | Accepted | 23ms | 3128 KiB | ||||
18 | Accepted | 24ms | 3112 KiB | ||||
19 | Accepted | 28ms | 3204 KiB | ||||
20 | Accepted | 21ms | 2912 KiB | ||||
21 | Accepted | 35ms | 3128 KiB | ||||
22 | Accepted | 21ms | 2892 KiB | ||||
subtask4 | 0/59 | ||||||
23 | Accepted | 409ms | 3220 KiB | ||||
24 | Accepted | 48ms | 2960 KiB | ||||
25 | Accepted | 317ms | 3124 KiB | ||||
26 | Time limit exceeded | 579ms | 3384 KiB | ||||
27 | Accepted | 259ms | 3128 KiB | ||||
28 | Time limit exceeded | 535ms | 3132 KiB | ||||
29 | Time limit exceeded | 600ms | 3128 KiB | ||||
30 | Time limit exceeded | 584ms | 3128 KiB | ||||
31 | Time limit exceeded | 589ms | 3784 KiB | ||||
32 | Time limit exceeded | 584ms | 3768 KiB | ||||
33 | Time limit exceeded | 578ms | 3128 KiB | ||||
34 | Time limit exceeded | 582ms | 3720 KiB | ||||
35 | Time limit exceeded | 578ms | 3900 KiB | ||||
36 | Time limit exceeded | 583ms | 3744 KiB | ||||
37 | Time limit exceeded | 589ms | 3952 KiB | ||||
38 | Time limit exceeded | 584ms | 3844 KiB | ||||
39 | Time limit exceeded | 586ms | 3832 KiB | ||||
40 | Time limit exceeded | 592ms | 3860 KiB | ||||
41 | Time limit exceeded | 574ms | 3840 KiB |