結果
問題 | No.2392 二平方和 |
ユーザー |
![]() |
提出日時 | 2023-07-30 22:51:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 423 bytes |
コンパイル時間 | 2,012 ms |
コンパイル使用メモリ | 192,276 KB |
最終ジャッジ日時 | 2025-02-15 21:06:35 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)#define ALL(v) v.begin(),v.end()typedef long long ll;#include <bits/stdc++.h>using namespace std;int main(){ios::sync_with_stdio(false);std::cin.tie(nullptr);ll p;cin>>p;for(int i=1;i*i<p;i++){for(int j=1;j<=i && j*j+i*i<=p;j++){if(j*j+i*i==p){cout<<"Yes"<<endl;return 0;}}}cout<<"No"<<endl;return 0;}