結果

問題 No.1593 Perfect Distance
ユーザー rlangevinrlangevin
提出日時 2021-07-13 21:40:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 159 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 86,668 KB
実行使用メモリ 107,136 KB
最終ジャッジ日時 2023-09-15 14:03:35
合計ジャッジ時間 3,353 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,024 KB
testcase_01 AC 73 ms
71,128 KB
testcase_02 AC 73 ms
71,264 KB
testcase_03 AC 70 ms
71,100 KB
testcase_04 AC 76 ms
71,020 KB
testcase_05 AC 75 ms
71,140 KB
testcase_06 AC 71 ms
71,112 KB
testcase_07 AC 72 ms
71,144 KB
testcase_08 AC 73 ms
71,284 KB
testcase_09 AC 79 ms
76,256 KB
testcase_10 AC 82 ms
78,888 KB
testcase_11 AC 84 ms
82,288 KB
testcase_12 AC 90 ms
87,444 KB
testcase_13 AC 96 ms
87,192 KB
testcase_14 AC 95 ms
90,056 KB
testcase_15 AC 106 ms
96,460 KB
testcase_16 AC 117 ms
107,136 KB
testcase_17 AC 71 ms
71,220 KB
testcase_18 AC 72 ms
71,224 KB
testcase_19 AC 70 ms
71,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = set()
for i in range(1, N + 1):
    S.add(i * i)

ans = 0
for i in range(1, N + 1):
    if N * N - i * i in S:
        ans += 1
print(ans)
0