結果

問題 No.2392 二平方和
ユーザー Anh Nguyễn Bảo
提出日時 2023-07-28 22:55:59
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 501 bytes
コンパイル時間 2,222 ms
コンパイル使用メモリ 179,324 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 20:42:38
合計ジャッジ時間 3,035 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("O3,Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
int n;
int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //freopen("main.inp","r",stdin);
    //freopen("main.out","w",stdout);
    cin>>n;
    for(int i=1;i<=sqrt(n);i++) {
        int j=n-i*i,c=sqrt(j);
        if(c*c==j) {
            cout<<"Yes";
            return 0;
        }
    }
    cout<<"No";
    return 0;
}
0