結果

問題 No.354 メルセンヌ素数
ユーザー Python00391232Python00391232
提出日時 2016-04-26 02:50:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 359 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 245,448 KB
最終ジャッジ日時 2024-04-15 04:31:48
合計ジャッジ時間 5,009 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
17,824 KB
testcase_01 AC 26 ms
10,752 KB
testcase_02 AC 26 ms
10,752 KB
testcase_03 AC 26 ms
10,752 KB
testcase_04 AC 28 ms
10,752 KB
testcase_05 AC 32 ms
10,752 KB
testcase_06 AC 42 ms
11,008 KB
testcase_07 AC 81 ms
12,288 KB
testcase_08 AC 473 ms
23,656 KB
testcase_09 TLE -
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

p = int(input())

mel = 2**p - 1
mel_bit = bin(mel)
mel_lists = list(mel_bit)
def num_Change(n):
	try:
		return int(n)
	except Exception:
		return 0
		
sets_mel = []
for i in range(len(mel_lists)):
	sets_mel.append(num_Change(mel_lists[i]))
	
while 0 in sets_mel:
	sets_mel.remove(0)

sums = 0
for i in range(len(sets_mel)):
	sums += sets_mel[i]
	
print(sums)
0