0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

yukicoder No.2795 Perfect Number 解説

Last updated at Posted at 2024-09-20

問題文

解説

なんかの検索エンジンで「完全数 一覧」と調べよう。すると、 $10^{18}$ 以下の完全数が $7$ 個しかないことに気付くだろう。
よって、これらとの一致判定を行えばよい。

解答例

#include <bits/stdc++.h>
using namespace std;
using ll=long long;

int main() {
  ll n;cin>>n;
  if(n==6||n==28||n==496||n==8128||n==33550336||n==8589869056||n==137438691328)cout<<"Yes\n";
  else cout<<"No\n";
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?