結果

問題 No.1593 Perfect Distance
ユーザー CleyLCleyL
提出日時 2021-10-18 20:42:17
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 289 bytes
コンパイル時間 648 ms
コンパイル使用メモリ 72,140 KB
実行使用メモリ 13,028 KB
最終ジャッジ日時 2023-10-19 21:02:12
合計ジャッジ時間 1,995 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 4 ms
4,348 KB
testcase_10 AC 10 ms
4,956 KB
testcase_11 AC 17 ms
5,724 KB
testcase_12 AC 25 ms
7,184 KB
testcase_13 AC 28 ms
7,444 KB
testcase_14 AC 31 ms
8,064 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

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