Submission #51567473


Source Code Expand

W, B = map(int, input().split())

S = ''

while len(S) < 200:
    S += 'wbwbwwbwbwbw'



ans = False
for i in range(len(S) + 1 - (W + B)):
    s = S[i:i + (W+B)]
    w = 0
    b = 0
    for j in range(W + B):
        if s[j] == 'w':
            w += 1
        elif s[j] == 'b':
            b += 1
    if W == w and B == b:
        ans = True
if ans:
    print('Yes')
else:
    print('No')

Submission Info

Submission Time
Task B - Piano
User zenmaaa
Language Python (PyPy 3.10-v7.3.12)
Score 200
Code Size 412 Byte
Status AC
Exec Time 64 ms
Memory 81588 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 22
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_yes_00.txt, 01_random_yes_01.txt, 02_random_yes_2_00.txt, 02_random_yes_2_01.txt, 02_random_yes_2_02.txt, 02_random_yes_2_03.txt, 03_random_no_00.txt, 03_random_no_01.txt, 04_random_no_2_00.txt, 04_random_no_2_01.txt, 04_random_no_2_02.txt, 04_random_no_2_03.txt, 05_handmade_00.txt, 05_handmade_01.txt, 05_handmade_02.txt, 05_handmade_03.txt, 05_handmade_04.txt, 05_handmade_05.txt, 05_handmade_06.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 59 ms 76496 KiB
00_sample_01.txt AC 60 ms 76312 KiB
00_sample_02.txt AC 61 ms 80816 KiB
01_random_yes_00.txt AC 59 ms 76584 KiB
01_random_yes_01.txt AC 62 ms 81228 KiB
02_random_yes_2_00.txt AC 62 ms 81192 KiB
02_random_yes_2_01.txt AC 61 ms 80796 KiB
02_random_yes_2_02.txt AC 63 ms 81588 KiB
02_random_yes_2_03.txt AC 62 ms 80676 KiB
03_random_no_00.txt AC 62 ms 81160 KiB
03_random_no_01.txt AC 61 ms 81072 KiB
04_random_no_2_00.txt AC 62 ms 81028 KiB
04_random_no_2_01.txt AC 61 ms 80728 KiB
04_random_no_2_02.txt AC 62 ms 80636 KiB
04_random_no_2_03.txt AC 62 ms 80812 KiB
05_handmade_00.txt AC 60 ms 76808 KiB
05_handmade_01.txt AC 59 ms 76404 KiB
05_handmade_02.txt AC 59 ms 76460 KiB
05_handmade_03.txt AC 60 ms 76476 KiB
05_handmade_04.txt AC 64 ms 81204 KiB
05_handmade_05.txt AC 60 ms 76620 KiB
05_handmade_06.txt AC 63 ms 81364 KiB