結果

問題 No.1593 Perfect Distance
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-07-09 21:23:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 144 bytes
コンパイル時間 1,308 ms
コンパイル使用メモリ 86,516 KB
実行使用メモリ 108,504 KB
最終ジャッジ日時 2023-09-14 07:30:29
合計ジャッジ時間 3,475 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,216 KB
testcase_01 AC 72 ms
71,392 KB
testcase_02 AC 70 ms
71,316 KB
testcase_03 AC 69 ms
71,504 KB
testcase_04 AC 70 ms
71,404 KB
testcase_05 AC 72 ms
71,500 KB
testcase_06 AC 70 ms
71,320 KB
testcase_07 AC 71 ms
71,404 KB
testcase_08 AC 70 ms
71,368 KB
testcase_09 AC 75 ms
76,168 KB
testcase_10 AC 95 ms
78,892 KB
testcase_11 AC 82 ms
82,604 KB
testcase_12 AC 90 ms
87,988 KB
testcase_13 AC 90 ms
88,160 KB
testcase_14 AC 94 ms
91,308 KB
testcase_15 AC 105 ms
97,748 KB
testcase_16 AC 114 ms
108,504 KB
testcase_17 AC 70 ms
71,316 KB
testcase_18 AC 70 ms
71,268 KB
testcase_19 AC 71 ms
71,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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