結果

問題 No.1593 Perfect Distance
ユーザー wolgnikwolgnik
提出日時 2021-07-09 21:40:10
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 269 ms
使用メモリ 112,084 KB
最終ジャッジ日時 2023-02-01 22:35:40
合計ジャッジ時間 3,286 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 81 ms
75,500 KB
testcase_01 AC 82 ms
75,536 KB
testcase_02 AC 81 ms
75,496 KB
testcase_03 AC 81 ms
75,504 KB
testcase_04 AC 82 ms
75,732 KB
testcase_05 AC 83 ms
75,656 KB
testcase_06 AC 82 ms
75,720 KB
testcase_07 AC 83 ms
75,576 KB
testcase_08 AC 86 ms
75,536 KB
testcase_09 AC 97 ms
81,092 KB
testcase_10 AC 95 ms
83,824 KB
testcase_11 AC 101 ms
87,104 KB
testcase_12 AC 108 ms
92,188 KB
testcase_13 AC 109 ms
92,196 KB
testcase_14 AC 112 ms
95,020 KB
testcase_15 AC 122 ms
101,384 KB
testcase_16 AC 129 ms
112,084 KB
testcase_17 AC 82 ms
75,768 KB
testcase_18 AC 82 ms
75,500 KB
testcase_19 AC 82 ms
75,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N = int(input())
sq = set()
for x in range(1, N + 1):
  if x ** 2 in range(N ** 2+ 1): sq.add(x ** 2)
res = 0
for x in range(1, N):
  y = N ** 2 - x ** 2
  if y in range(1, N ** 2 + 1): res += y in sq
print(res)
0