結果
問題 | No.2392 二平方和 |
ユーザー |
![]() |
提出日時 | 2023-10-01 20:26:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 115 ms / 2,000 ms |
コード長 | 472 bytes |
コンパイル時間 | 1,481 ms |
コンパイル使用メモリ | 165,832 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-26 13:32:24 |
合計ジャッジ時間 | 2,747 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 |
ソースコード
#include "bits/stdc++.h"using namespace std;#define int long long#define rep(i, n) for (int i = 0; i < n; i++)#define rep1(j, n) for (int j = 0; j < n; j++)#define rep2(t, n) for (int t = 0; t < n; t++)signed main() {int p;cin >> p;for (int i = 1; i < p; i++) {int t = i * i;if (t >= p)continue;int h = p - t;int g = sqrt(h);if (sqrt(h) == g) {cout << "Yes" << endl;return 0;}}cout << "No" << endl;}