結果

問題 No.1593 Perfect Distance
ユーザー ProgrammerryokiProgrammerryoki
提出日時 2021-07-09 21:40:59
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 597 ms / 2,000 ms
コード長 193 bytes
コンパイル時間 66 ms
使用メモリ 7,948 KB
最終ジャッジ日時 2023-02-01 22:37:53
合計ジャッジ時間 3,537 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 16 ms
7,744 KB
testcase_01 AC 16 ms
7,772 KB
testcase_02 AC 15 ms
7,904 KB
testcase_03 AC 16 ms
7,912 KB
testcase_04 AC 15 ms
7,788 KB
testcase_05 AC 15 ms
7,788 KB
testcase_06 AC 15 ms
7,948 KB
testcase_07 AC 16 ms
7,752 KB
testcase_08 AC 18 ms
7,788 KB
testcase_09 AC 41 ms
7,784 KB
testcase_10 AC 96 ms
7,920 KB
testcase_11 AC 144 ms
7,892 KB
testcase_12 AC 238 ms
7,788 KB
testcase_13 AC 253 ms
7,856 KB
testcase_14 AC 292 ms
7,760 KB
testcase_15 AC 421 ms
7,768 KB
testcase_16 AC 597 ms
7,784 KB
testcase_17 AC 15 ms
7,912 KB
testcase_18 AC 16 ms
7,900 KB
testcase_19 AC 15 ms
7,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
count = 0
for x in range(1, N):
    if x**2 > N**2:
        break
    y = round((N**2 - x**2)**0.5)
    # print(x,y)
    if y**2 + x**2 == N**2:
        count += 1
print(count)
0