結果
| 問題 | No.2795 Perfect Number |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-28 23:12:28 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 287 bytes |
| 記録 | |
| コンパイル時間 | 283 ms |
| コンパイル使用メモリ | 71,892 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-01 09:14:49 |
| 合計ジャッジ時間 | 2,052 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 WA * 4 |
ソースコード
#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";
}
}