結果

問題 No.354 メルセンヌ素数
ユーザー fumi6328
提出日時 2018-09-10 18:32:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 274 bytes
コンパイル時間 762 ms
コンパイル使用メモリ 59,584 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-30 14:40:42
合計ジャッジ時間 1,528 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 2 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int p;
    cin >> p;
    
    p = pow(2,p) - 1;

    int ans = 0;
    while(p != 0){
        if(p % 2 != 0) ans++;
        p /=2;
    }

    cout << ans << endl;

    return 0;
}
0