結果

問題 No.354 メルセンヌ素数
ユーザー たつおたつお
提出日時 2023-09-29 17:16:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 276 bytes
コンパイル時間 664 ms
コンパイル使用メモリ 64,756 KB
実行使用メモリ 7,512 KB
最終ジャッジ日時 2023-09-29 17:16:44
合計ジャッジ時間 3,375 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
7,504 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main(void){
//input
	int p; cin >> p;
//calc
	int prime=1;
	for(int i=0;i<p;i++){
		prime *= 2;
	}
	prime -= 1;
	
	int cnt=0;
	while(prime > 0){
		if(prime % 2 == 1){
			cnt++;
		}
		prime /= 2;
	}
//output
	cout << cnt << endl;
}
0