結果

問題 No.1593 Perfect Distance
ユーザー osm ibtosm ibt
提出日時 2021-07-10 12:30:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 77,128 KB
最終ジャッジ日時 2023-09-14 18:51:28
合計ジャッジ時間 2,919 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,112 KB
testcase_01 AC 71 ms
71,732 KB
testcase_02 AC 72 ms
71,448 KB
testcase_03 AC 72 ms
71,580 KB
testcase_04 AC 71 ms
71,432 KB
testcase_05 AC 71 ms
71,828 KB
testcase_06 AC 71 ms
71,732 KB
testcase_07 AC 71 ms
71,756 KB
testcase_08 AC 77 ms
76,844 KB
testcase_09 AC 83 ms
76,636 KB
testcase_10 AC 84 ms
76,872 KB
testcase_11 AC 88 ms
76,880 KB
testcase_12 AC 90 ms
76,832 KB
testcase_13 AC 91 ms
76,716 KB
testcase_14 AC 93 ms
76,880 KB
testcase_15 AC 99 ms
77,060 KB
testcase_16 AC 103 ms
77,128 KB
testcase_17 AC 71 ms
71,332 KB
testcase_18 AC 71 ms
71,880 KB
testcase_19 AC 70 ms
71,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ret = 0
for x in range(1, n):
    yy = n * n - x * x
    ynear = int(yy**0.5)
    for y in [ynear-1, ynear, ynear+1]:
        if y * y == yy:
            ret += 1
print(ret)
0