結果

問題 No.2795 Perfect Number
ユーザー
提出日時 2024-06-28 23:12:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 287 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 62,720 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 23:12:30
合計ジャッジ時間 1,659 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
using ull = unsigned long long;

int main( ){
    ull x;
    cin >> x;

    int c = 0;
    while (!((x >> c) & 1ull)) {
        c++;
    }
    if ((x >> c) == (1ull << (c+1))-1) {
        cout << "Yes";
    } else {
        cout << "No";
    }
}
0