結果
| 問題 |
No.2795 Perfect Number
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-28 21:21:46 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 594 bytes |
| コンパイル時間 | 4,280 ms |
| コンパイル使用メモリ | 250,896 KB |
| 最終ジャッジ日時 | 2025-02-22 00:51:23 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 |
コンパイルメッセージ
main.cpp:8:12: warning: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’
8 | bool chmin(auto &a, auto b){if(a > b){a = b; return true;} return false;}
| ^~~~
main.cpp:8:21: warning: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’
8 | bool chmin(auto &a, auto b){if(a > b){a = b; return true;} return false;}
| ^~~~
main.cpp:9:12: warning: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’
9 | bool chmax(auto &a, auto b){if(a < b){a = b; return true;} return false;}
| ^~~~
main.cpp:9:21: warning: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’
9 | bool chmax(auto &a, auto b){if(a < b){a = b; return true;} return false;}
| ^~~~
ソースコード
#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
#define rep(i,a,b) for(ll i = a; i < b; i++)
#define all(a) (a).begin(), (a).end()
bool chmin(auto &a, auto b){if(a > b){a = b; return true;} return false;}
bool chmax(auto &a, auto b){if(a < b){a = b; return true;} return false;}
int main(){
vector<ll> a = {6, 28, 496, 8128, 33550336, 8589869056, 137438691328, 2305843008139952128};
ll n;
cin >> n;
if(find(all(a), n) != a.end()){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
}