結果

問題 No.1593 Perfect Distance
ユーザー googol_S0googol_S0
提出日時 2021-07-09 21:22:52
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 156 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 87,276 KB
実行使用メモリ 108,764 KB
最終ジャッジ日時 2023-09-14 07:26:31
合計ジャッジ時間 2,846 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,276 KB
testcase_01 AC 70 ms
71,160 KB
testcase_02 AC 70 ms
71,292 KB
testcase_03 AC 69 ms
71,160 KB
testcase_04 AC 74 ms
71,288 KB
testcase_05 AC 70 ms
71,116 KB
testcase_06 AC 70 ms
71,188 KB
testcase_07 AC 70 ms
71,152 KB
testcase_08 AC 70 ms
71,428 KB
testcase_09 AC 77 ms
76,252 KB
testcase_10 AC 78 ms
79,104 KB
testcase_11 AC 88 ms
82,352 KB
testcase_12 AC 91 ms
88,068 KB
testcase_13 AC 90 ms
88,060 KB
testcase_14 AC 98 ms
90,944 KB
testcase_15 AC 105 ms
97,492 KB
testcase_16 AC 119 ms
108,764 KB
testcase_17 AC 69 ms
71,424 KB
testcase_18 AC 70 ms
71,060 KB
testcase_19 AC 70 ms
71,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
X=[i*i for i in range(1,N+1)]
M=N*N
S=set()
ANS=0
for i in range(N):
  S.add(X[i])
for i in range(N):
  if M-X[i] in S:
    ANS+=1
print(ANS)
0