結果

問題 No.2795 Perfect Number
ユーザー noya2
提出日時 2024-06-07 03:00:42
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 360 bytes
コンパイル時間 2,442 ms
コンパイル使用メモリ 249,700 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 20:50:18
合計ジャッジ時間 3,365 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

int main(){
    const std::vector<long long> perfect_numbers = {
        6,
        28,
        496,
        8128,
        33550336,
        8589869056,
        137438691328
    };
    long long n; std::cin >> n;
    std::cout << (std::ranges::any_of(perfect_numbers, [n](long long x){ return x == n; }) ? "Yes" : "No") << std::endl;
}
0