結果

問題 No.1593 Perfect Distance
ユーザー lam6er
提出日時 2025-03-20 18:41:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 170 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 82,664 KB
実行使用メモリ 76,596 KB
最終ジャッジ日時 2025-03-20 18:41:48
合計ジャッジ時間 2,204 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = int(input())
ans = 0
for x in range(1, n):
    y_sq = n * n - x * x
    y = math.isqrt(y_sq)
    if y * y == y_sq and y >= 1:
        ans += 1
print(ans)
0