結果
| 問題 |
No.2795 Perfect Number
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-28 21:37:00 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 929 bytes |
| コンパイル時間 | 4,873 ms |
| コンパイル使用メモリ | 271,844 KB |
| 実行使用メモリ | 13,752 KB |
| 最終ジャッジ日時 | 2024-06-28 21:37:08 |
| 合計ジャッジ時間 | 6,824 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 WA * 1 TLE * 1 -- * 32 |
ソースコード
#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
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;
int sum = 1;
if(n == 1)cout<<"no"<<endl;
else{
for(int i= 2; i<=sqrtl(n); i++){
if(n%i ==0){
sum+= i;
if(i != n/i)
sum+= n/i;
}
}
}
if(sum == n)cout<<"Yes"<<endl;
else 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;
}
/*
*/