結果
| 問題 | No.2795 Perfect Number |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-29 22:47:16 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 402 bytes |
| 記録 | |
| コンパイル時間 | 996 ms |
| コンパイル使用メモリ | 178,696 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-02 01:03:40 |
| 合計ジャッジ時間 | 5,763 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 1 TLE * 1 -- * 18 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
using ll = long long int;
int main() {
ll N;
cin >> N;
ll ans = 0;
ll n2 = N * 2;
ll k = 1;
while (n2 > 0) {
if (N % k == 0) {
n2 -= k + N / k;
ans += k + N / k;
}
k++;
}
if (ans == N * 2)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}