結果

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

ソースコード

diff #

#pragma optimise "i'll_die_virgin"
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
#if __cplusplus >= 202002L
using namespace numbers;
#endif


int arr[] ={6,                // 2^1 * (2^2 - 1)
        28,               // 2^2 * (2^3 - 1)
        496,              // 2^4 * (2^5 - 1)
        8128,             // 2^6 * (2^7 - 1)
        33550336,         // 2^12 * (2^13 - 1)
        8589869056,       // 2^16 * (2^17 - 1)
        137438691328,     // 2^18 * (2^19 - 1)
        2305843008139952128};


int32_t main(){
    cin.tie(0)->sync_with_stdio(0);
    //freopen("err.txt","w",stderr);
    cin.exceptions(ios::badbit | ios::failbit);
    auto __solve_tc = [&](auto __tc_num)->void{
        int n;
        cin>>n;
        for(auto it: arr){
            if(it == n){
                cout<<"Yes"<<endl;
                return;
            }
        }
        cout<<"No"<<endl;
        
    };
    int __tc_cnt = 1;
    // cin >> __tc_cnt;
    for(auto __tc_num = 0; __tc_num < __tc_cnt; ++ __tc_num){
        __solve_tc(__tc_num);
    }
    return 0;
}

/*

*/
0