結果

問題 No.1593 Perfect Distance
ユーザー 👑 CleyL
提出日時 2021-10-18 20:42:17
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 289 bytes
コンパイル時間 606 ms
コンパイル使用メモリ 72,472 KB
実行使用メモリ 12,928 KB
最終ジャッジ日時 2024-09-19 17:06:41
合計ジャッジ時間 1,691 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <set>
using namespace std;
int main(){
    set<long long> x;
    int n;cin>>n;
    for(int i = 1; n > i; i++){
        x.insert(i*i);
    }
    int a = 0;
    for(int i = 1; n > i; i++){
        if(x.find(n*n-i*i) != x.end())a++;
    }
    cout << a << endl;
}
0