結果

問題 No.1593 Perfect Distance
ユーザー KudeKude
提出日時 2021-07-09 21:23:38
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 169 bytes
コンパイル時間 276 ms
使用メモリ 112,028 KB
最終ジャッジ日時 2023-02-01 21:47:21
合計ジャッジ時間 3,478 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 85 ms
75,572 KB
testcase_01 AC 85 ms
75,784 KB
testcase_02 AC 86 ms
75,336 KB
testcase_03 AC 84 ms
75,364 KB
testcase_04 AC 84 ms
75,792 KB
testcase_05 AC 84 ms
75,460 KB
testcase_06 AC 85 ms
75,488 KB
testcase_07 AC 84 ms
75,412 KB
testcase_08 AC 86 ms
75,676 KB
testcase_09 AC 93 ms
80,888 KB
testcase_10 AC 96 ms
83,444 KB
testcase_11 AC 98 ms
86,880 KB
testcase_12 AC 105 ms
92,064 KB
testcase_13 AC 107 ms
91,976 KB
testcase_14 AC 110 ms
94,760 KB
testcase_15 AC 119 ms
101,060 KB
testcase_16 AC 129 ms
112,028 KB
testcase_17 AC 85 ms
75,492 KB
testcase_18 AC 82 ms
75,728 KB
testcase_19 AC 85 ms
75,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
n2 = n ** 2
ans = 0
sqs = set()
for i in range(1, n + 1):
    sqs.add(i * i)
for x in range(1, n + 1):
    r = n2 - x * x
    ans += r in sqs
print(ans)
0