115502024-10-26 14:14:24balintPeriodikus Szavakpython3Time limit exceeded 41/100600ms3952 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()
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted16ms2872 KiB
subtask214/14
2Accepted16ms2864 KiB
3Accepted16ms2876 KiB
4Accepted17ms3052 KiB
5Accepted16ms2872 KiB
6Accepted16ms3012 KiB
7Accepted16ms3064 KiB
8Accepted16ms3080 KiB
9Accepted16ms2872 KiB
10Accepted16ms2864 KiB
11Accepted16ms2972 KiB
12Accepted16ms3080 KiB
subtask327/27
13Accepted25ms3128 KiB
14Accepted23ms3128 KiB
15Accepted24ms3116 KiB
16Accepted17ms2880 KiB
17Accepted23ms3128 KiB
18Accepted24ms3112 KiB
19Accepted28ms3204 KiB
20Accepted21ms2912 KiB
21Accepted35ms3128 KiB
22Accepted21ms2892 KiB
subtask40/59
23Accepted409ms3220 KiB
24Accepted48ms2960 KiB
25Accepted317ms3124 KiB
26Time limit exceeded579ms3384 KiB
27Accepted259ms3128 KiB
28Time limit exceeded535ms3132 KiB
29Time limit exceeded600ms3128 KiB
30Time limit exceeded584ms3128 KiB
31Time limit exceeded589ms3784 KiB
32Time limit exceeded584ms3768 KiB
33Time limit exceeded578ms3128 KiB
34Time limit exceeded582ms3720 KiB
35Time limit exceeded578ms3900 KiB
36Time limit exceeded583ms3744 KiB
37Time limit exceeded589ms3952 KiB
38Time limit exceeded584ms3844 KiB
39Time limit exceeded586ms3832 KiB
40Time limit exceeded592ms3860 KiB
41Time limit exceeded574ms3840 KiB