結果

問題 No.7 プライムナンバーゲーム
ユーザー 1up_aloe1up_aloe
提出日時 2018-01-29 21:28:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,072 ms / 5,000 ms
コード長 406 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-09 04:26:06
合計ジャッジ時間 14,898 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,880 KB
testcase_01 AC 31 ms
11,008 KB
testcase_02 AC 2,072 ms
11,008 KB
testcase_03 AC 162 ms
10,752 KB
testcase_04 AC 61 ms
10,880 KB
testcase_05 AC 60 ms
10,752 KB
testcase_06 AC 608 ms
10,880 KB
testcase_07 AC 423 ms
10,880 KB
testcase_08 AC 201 ms
10,752 KB
testcase_09 AC 928 ms
10,752 KB
testcase_10 AC 29 ms
10,880 KB
testcase_11 AC 426 ms
10,752 KB
testcase_12 AC 1,494 ms
10,752 KB
testcase_13 AC 1,575 ms
10,880 KB
testcase_14 AC 2,020 ms
10,880 KB
testcase_15 AC 2,008 ms
10,880 KB
testcase_16 AC 1,790 ms
11,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

nin = int(input())
setp = [2]


for i in range(3,nin,2):
	for item in filter(lambda x : x <= i**(1/2),setp):
		if i % item == 0:
			break
	else:
		setp.append(i)

bool_lis = [False]*(nin+1)
bool_lis[0] = True
bool_lis[1] = True

for i in range(4,nin+1):
	for num in filter(lambda x : x < i, setp):
		if not bool_lis[i - num]:
			bool_lis[i] = True


if bool_lis[nin]:
	print ("Win")
else:
	print ("Lose")
	
0