提出 #29451561


ソースコード 拡げる

import math


def is_prime(x):
    for i in range(2, int(math.sqrt(x)) + 1):
        if x % i == 0:
            return False
    return True


a, b, c, d = map(int, input().split())
is_prime_list = [is_prime(x) for x in range(b + d + 1)]

# print(is_prime_list)

ans = "Aoki"
for i in range(a, b + 1):
    aoki_win = False
    for j in range(c, d + 1):
        if is_prime_list[i + j]:
            aoki_win = True
            break
    if not aoki_win:
        ans = "Takahashi"
print(ans)

提出情報

提出日時
問題 D - Prime Sum Game
ユーザ gae1202
言語 Python (3.8.2)
得点 400
コード長 515 Byte
結果 AC
実行時間 25 ms
メモリ 9168 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 400 / 400
結果
AC × 3
AC × 33
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, hand_02.txt, hand_03.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, sample_01.txt, sample_02.txt, sample_03.txt
ケース名 結果 実行時間 メモリ
hand_01.txt AC 25 ms 8876 KiB
hand_02.txt AC 18 ms 8872 KiB
hand_03.txt AC 20 ms 9012 KiB
random_01.txt AC 19 ms 9164 KiB
random_02.txt AC 20 ms 9160 KiB
random_03.txt AC 20 ms 9052 KiB
random_04.txt AC 20 ms 9104 KiB
random_05.txt AC 20 ms 8880 KiB
random_06.txt AC 18 ms 9052 KiB
random_07.txt AC 23 ms 8872 KiB
random_08.txt AC 18 ms 9164 KiB
random_09.txt AC 23 ms 9052 KiB
random_10.txt AC 24 ms 8980 KiB
random_11.txt AC 22 ms 8876 KiB
random_12.txt AC 20 ms 9052 KiB
random_13.txt AC 18 ms 9024 KiB
random_14.txt AC 19 ms 9052 KiB
random_15.txt AC 18 ms 9156 KiB
random_16.txt AC 21 ms 8876 KiB
random_17.txt AC 18 ms 8872 KiB
random_18.txt AC 19 ms 9104 KiB
random_19.txt AC 21 ms 9044 KiB
random_20.txt AC 20 ms 8872 KiB
random_21.txt AC 18 ms 9168 KiB
random_22.txt AC 24 ms 9104 KiB
random_23.txt AC 19 ms 9052 KiB
random_24.txt AC 21 ms 9052 KiB
random_25.txt AC 25 ms 8872 KiB
random_26.txt AC 19 ms 8872 KiB
random_27.txt AC 19 ms 9024 KiB
sample_01.txt AC 18 ms 9104 KiB
sample_02.txt AC 18 ms 9052 KiB
sample_03.txt AC 18 ms 9164 KiB