結果
| 問題 | No.2392 二平方和 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-28 21:23:58 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 593 bytes |
| 記録 | |
| コンパイル時間 | 1,152 ms |
| コンパイル使用メモリ | 208,956 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-01 21:54:40 |
| 合計ジャッジ時間 | 2,116 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 26 |
ソースコード
#include <bits/stdc++.h>
#define lson(x) x<<1
#define rson(x) x<<1|1
#define int long long
#define inf 1000000007
#define mod 1000000007
using namespace std;
const int maxn=2e5+5;
void solve()
{
int p;
cin>>p;
for(int i=1;i*i<=p;i++)
{
int val=p-i*i;
int val2=sqrt(val);
if(val2*val2==val)
{
cout<<"Yes\n";
return ;
}
}
cout<<"No\n";
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t=1;
// cin>>t;
while(t--)
{
solve();
}
return 0;
}