結果

問題 No.1593 Perfect Distance
ユーザー brthyyjpbrthyyjp
提出日時 2021-07-09 21:25:04
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 151 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,016 KB
実行使用メモリ 107,736 KB
最終ジャッジ日時 2023-09-14 07:37:52
合計ジャッジ時間 2,933 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,660 KB
testcase_01 AC 69 ms
71,408 KB
testcase_02 AC 69 ms
71,336 KB
testcase_03 AC 70 ms
71,336 KB
testcase_04 AC 70 ms
71,188 KB
testcase_05 AC 69 ms
71,472 KB
testcase_06 AC 70 ms
71,668 KB
testcase_07 AC 71 ms
71,504 KB
testcase_08 AC 71 ms
71,568 KB
testcase_09 AC 77 ms
76,708 KB
testcase_10 AC 79 ms
79,048 KB
testcase_11 AC 84 ms
82,676 KB
testcase_12 AC 89 ms
87,800 KB
testcase_13 AC 90 ms
87,812 KB
testcase_14 AC 96 ms
90,608 KB
testcase_15 AC 106 ms
96,628 KB
testcase_16 AC 118 ms
107,736 KB
testcase_17 AC 71 ms
71,504 KB
testcase_18 AC 71 ms
71,228 KB
testcase_19 AC 70 ms
71,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = set()
for i in range(1, n+1):
    S.add(i**2)
ans = 0
z = n**2
for x in S:
    y = z-x
    if y in S:
        ans += 1
print(ans)
0