結果

問題 No.1593 Perfect Distance
ユーザー wolgnikwolgnik
提出日時 2021-07-09 21:40:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 473 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 107,544 KB
最終ジャッジ日時 2023-09-14 08:10:14
合計ジャッジ時間 3,465 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,236 KB
testcase_01 AC 78 ms
71,504 KB
testcase_02 AC 78 ms
71,496 KB
testcase_03 AC 79 ms
71,188 KB
testcase_04 AC 80 ms
71,164 KB
testcase_05 AC 78 ms
71,260 KB
testcase_06 AC 79 ms
71,020 KB
testcase_07 AC 80 ms
71,500 KB
testcase_08 AC 82 ms
71,388 KB
testcase_09 AC 106 ms
76,860 KB
testcase_10 AC 92 ms
79,288 KB
testcase_11 AC 101 ms
82,672 KB
testcase_12 AC 107 ms
87,484 KB
testcase_13 AC 108 ms
87,676 KB
testcase_14 AC 112 ms
90,752 KB
testcase_15 AC 128 ms
96,840 KB
testcase_16 AC 134 ms
107,544 KB
testcase_17 AC 79 ms
71,268 KB
testcase_18 AC 80 ms
71,080 KB
testcase_19 AC 78 ms
71,160 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