結果
| 問題 |
No.2795 Perfect Number
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-28 21:23:45 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 249 bytes |
| コンパイル時間 | 2,824 ms |
| コンパイル使用メモリ | 242,184 KB |
| 実行使用メモリ | 10,140 KB |
| 最終ジャッジ日時 | 2024-06-28 21:23:56 |
| 合計ジャッジ時間 | 8,885 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 1 TLE * 2 -- * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
LL n, s;
int main() {
cin >> n;
for (LL i = 1; i * i <= n; ++i) {
if (n % i == 0) s += i, s += n / i;
if (s > 2 * n) break;
}
puts(s == 2 * n ? "Yes" : "No");
return 0;
}