結果
| 問題 | No.2795 Perfect Number |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-28 23:12:28 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 287 bytes |
| 記録 | |
| コンパイル時間 | 399 ms |
| コンパイル使用メモリ | 72,796 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-03-18 05:43:27 |
| 合計ジャッジ時間 | 1,482 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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";
}
}