結果

問題 No.1593 Perfect Distance
ユーザー titan23titan23
提出日時 2022-06-29 01:46:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 481 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 76,556 KB
最終ジャッジ日時 2023-08-14 02:56:54
合計ジャッジ時間 3,213 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
75,756 KB
testcase_01 AC 64 ms
75,932 KB
testcase_02 AC 62 ms
75,728 KB
testcase_03 AC 62 ms
75,648 KB
testcase_04 AC 60 ms
75,644 KB
testcase_05 AC 75 ms
75,800 KB
testcase_06 AC 62 ms
75,892 KB
testcase_07 AC 63 ms
75,860 KB
testcase_08 AC 62 ms
75,708 KB
testcase_09 AC 65 ms
76,516 KB
testcase_10 AC 63 ms
76,300 KB
testcase_11 AC 67 ms
76,512 KB
testcase_12 AC 69 ms
76,400 KB
testcase_13 AC 72 ms
76,556 KB
testcase_14 AC 72 ms
76,544 KB
testcase_15 AC 72 ms
76,248 KB
testcase_16 AC 74 ms
76,220 KB
testcase_17 AC 65 ms
75,828 KB
testcase_18 AC 62 ms
75,828 KB
testcase_19 AC 60 ms
75,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
input = lambda: sys.stdin.readline().rstrip()

#  -----------------------  #

n = int(input())
ans = 0
for x in range(1, 200001):
  y2 = n*n - x*x
  if y2 > 0 and math.sqrt(y2) % 1 == 0:
    ans += 1
print(ans)
0