結果

問題 No.7 プライムナンバーゲーム
ユーザー momike1341momike1341
提出日時 2020-04-03 04:10:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 404 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,796 KB
実行使用メモリ 8,484 KB
最終ジャッジ日時 2023-09-11 03:09:35
合計ジャッジ時間 1,291 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 17 ms
7,980 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 16 ms
8,052 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 19 ms
8,276 KB
testcase_15 AC 19 ms
8,352 KB
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N=int(input())
cont=0
so_list=[True for i in range(N)]
for i in range(2,int(math.sqrt(N))+1):
    if not so_list[i]:
        continue
    for j in range(i**2,N,i):
        so_list[j]=False
Comparison=N
for i in range(len(so_list)-1,1,-1):
    if so_list[i]:
        cont+=1
        Comparison-=i
        if Comparison==1 or 0:
            break
print('win' if cont%2==0 else 'Lose')
        
0