Submission #1843336


Source Code Expand

S = input()
T = input()
q = int(input())
querys = [tuple(map(lambda x: int(x) - 1, input().split())) for i in range(q)]

for a, b, c, d in querys:
    lenS = b - a + 1
    numAS = S[a:b + 1].count('A')
    lenT = d - c + 1
    numAT = T[c:d + 1].count('A')

    if ((numAS - (lenS - numAS)) - (numAT - (lenT - numAT))) % 3 == 0:
        print('YES')
    else:
        print('NO')

Submission Info

Submission Time
Task E - TrBBnsformBBtion
User ZollingerPython3
Language Python (3.4.3)
Score 0
Code Size 395 Byte
Status TLE
Exec Time 2105 ms
Memory 25260 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 600
Status
AC × 2
AC × 3
TLE × 13
Set Name Test Cases
Sample 0_000.txt, 0_001.txt
All 0_000.txt, 0_001.txt, bound_0.txt, bound_1.txt, bound_2.txt, bound_3.txt, min.txt, rnd_10000_10.txt, rnd_10000_10000.txt, rnd_10000_2.txt, rnd_10_10.txt, rnd_10_10000.txt, rnd_10_2.txt, rnd_2_10.txt, rnd_2_10000.txt, rnd_2_2.txt
Case Name Status Exec Time Memory
0_000.txt AC 17 ms 3060 KB
0_001.txt AC 17 ms 3060 KB
bound_0.txt TLE 2104 ms 18940 KB
bound_1.txt TLE 2104 ms 23680 KB
bound_2.txt TLE 2105 ms 22016 KB
bound_3.txt TLE 2105 ms 25244 KB
min.txt AC 17 ms 3060 KB
rnd_10000_10.txt TLE 2105 ms 25220 KB
rnd_10000_10000.txt TLE 2105 ms 25260 KB
rnd_10000_2.txt TLE 2105 ms 25196 KB
rnd_10_10.txt TLE 2105 ms 25216 KB
rnd_10_10000.txt TLE 2105 ms 25220 KB
rnd_10_2.txt TLE 2105 ms 25192 KB
rnd_2_10.txt TLE 2105 ms 25188 KB
rnd_2_10000.txt TLE 2105 ms 25216 KB
rnd_2_2.txt TLE 2105 ms 25192 KB