結果

問題 No.1593 Perfect Distance
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-07-11 18:22:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 160 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 28,068 KB
最終ジャッジ日時 2023-09-14 20:17:23
合計ジャッジ時間 4,069 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
27,884 KB
testcase_01 AC 136 ms
27,916 KB
testcase_02 AC 143 ms
27,920 KB
testcase_03 AC 137 ms
27,932 KB
testcase_04 AC 136 ms
27,880 KB
testcase_05 AC 137 ms
27,832 KB
testcase_06 AC 140 ms
27,928 KB
testcase_07 AC 133 ms
27,960 KB
testcase_08 AC 135 ms
27,960 KB
testcase_09 AC 139 ms
27,904 KB
testcase_10 AC 141 ms
27,884 KB
testcase_11 AC 141 ms
27,912 KB
testcase_12 AC 142 ms
27,924 KB
testcase_13 AC 141 ms
28,068 KB
testcase_14 AC 147 ms
27,912 KB
testcase_15 AC 146 ms
27,884 KB
testcase_16 AC 146 ms
27,908 KB
testcase_17 AC 136 ms
28,028 KB
testcase_18 AC 142 ms
27,908 KB
testcase_19 AC 141 ms
27,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

heiho = set([i ** 2 for i in range(1, 200010)])
n = int(input())
ans = 0
for i in range(1, 200010):
    if n ** 2 - i ** 2 in heiho:
        ans += 1
print(ans)
0