結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
15,560 KB
testcase_01 AC 10 ms
6,416 KB
testcase_02 AC 11 ms
6,416 KB
testcase_03 AC 11 ms
6,416 KB
testcase_04 AC 14 ms
6,448 KB
testcase_05 AC 23 ms
6,528 KB
testcase_06 AC 230 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