結果

問題 No.7 プライムナンバーゲーム
ユーザー GrayCoderGrayCoder
提出日時 2017-10-08 03:35:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2023-08-10 19:49:12
合計ジャッジ時間 1,952 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,832 KB
testcase_01 AC 14 ms
7,880 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 15 ms
7,892 KB
testcase_05 WA -
testcase_06 AC 19 ms
7,836 KB
testcase_07 AC 19 ms
7,892 KB
testcase_08 AC 17 ms
7,792 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 18 ms
7,960 KB
testcase_12 AC 24 ms
7,804 KB
testcase_13 AC 24 ms
7,820 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 24 ms
7,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())

    for i in range(N - 2, 0, -1):
        if is_prime(i):
            x = N - i

    if x % 2:
        print('Win')
    else:
        print('Lose')

def is_prime(n):
    if n < 2:
        return False
    else:
        for i in range(2, n):
            if i * i > n:
                break
            elif n % i == 0:
                return False
        return True

main()
0