結果

問題 No.354 メルセンヌ素数
ユーザー bellangeldindonbellangeldindon
提出日時 2019-05-16 16:54:55
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 198 bytes
コンパイル時間 59 ms
コンパイル使用メモリ 7,104 KB
実行使用メモリ 13,528 KB
最終ジャッジ日時 2023-10-17 06:56:52
合計ジャッジ時間 3,425 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
10,764 KB
testcase_01 AC 11 ms
6,416 KB
testcase_02 AC 12 ms
6,416 KB
testcase_03 AC 12 ms
6,416 KB
testcase_04 AC 16 ms
6,448 KB
testcase_05 AC 24 ms
6,528 KB
testcase_06 AC 231 ms
7,052 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def pow2(n):
	ans = 1
	for i in range(0, n):
		ans *= 2
	return ans

def countone(n):
	m = n
	cnt = 0
	while m != 0:
		cnt += m%2
		m /= 2
	return cnt

p = int(raw_input())
print countone(pow2(p)-1)
0