結果

問題 No.1593 Perfect Distance
ユーザー brthyyjpbrthyyjp
提出日時 2021-07-09 21:25:04
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 151 bytes
コンパイル時間 265 ms
使用メモリ 111,960 KB
最終ジャッジ日時 2023-02-01 21:56:07
合計ジャッジ時間 3,425 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 85 ms
75,720 KB
testcase_01 AC 85 ms
75,748 KB
testcase_02 AC 83 ms
75,792 KB
testcase_03 AC 82 ms
75,784 KB
testcase_04 AC 83 ms
75,848 KB
testcase_05 AC 83 ms
75,484 KB
testcase_06 AC 83 ms
75,752 KB
testcase_07 AC 83 ms
75,484 KB
testcase_08 AC 83 ms
75,744 KB
testcase_09 AC 91 ms
80,736 KB
testcase_10 AC 93 ms
83,640 KB
testcase_11 AC 97 ms
87,020 KB
testcase_12 AC 104 ms
92,040 KB
testcase_13 AC 105 ms
92,300 KB
testcase_14 AC 108 ms
95,204 KB
testcase_15 AC 118 ms
101,208 KB
testcase_16 AC 129 ms
111,960 KB
testcase_17 AC 84 ms
75,624 KB
testcase_18 AC 83 ms
75,548 KB
testcase_19 AC 83 ms
75,648 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