結果

問題 No.1593 Perfect Distance
ユーザー miya145592miya145592
提出日時 2023-05-07 01:35:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 184 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 86,780 KB
実行使用メモリ 76,624 KB
最終ジャッジ日時 2023-08-15 20:26:53
合計ジャッジ時間 3,574 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
71,336 KB
testcase_01 AC 61 ms
71,300 KB
testcase_02 AC 60 ms
71,484 KB
testcase_03 AC 60 ms
71,300 KB
testcase_04 AC 62 ms
71,548 KB
testcase_05 AC 61 ms
71,208 KB
testcase_06 AC 61 ms
71,248 KB
testcase_07 AC 61 ms
71,316 KB
testcase_08 AC 62 ms
71,292 KB
testcase_09 AC 73 ms
76,460 KB
testcase_10 AC 66 ms
76,312 KB
testcase_11 AC 67 ms
76,520 KB
testcase_12 AC 68 ms
76,556 KB
testcase_13 AC 66 ms
76,508 KB
testcase_14 AC 68 ms
76,624 KB
testcase_15 AC 69 ms
76,408 KB
testcase_16 AC 69 ms
76,256 KB
testcase_17 AC 60 ms
71,216 KB
testcase_18 AC 61 ms
71,220 KB
testcase_19 AC 63 ms
71,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N = int(input())
N2 = N*N
cnt = 0
for x in range(1, N+1):
    y2 = N2-x*x
    if y2<=0:
        break
    y = int(math.sqrt(y2))
    if y*y==y2:
        cnt += 1
print(cnt)
0