結果

問題 No.1593 Perfect Distance
ユーザー harurunharurun
提出日時 2021-07-09 21:26:48
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 172 bytes
コンパイル時間 400 ms
使用メモリ 111,684 KB
最終ジャッジ日時 2023-02-01 22:03:50
合計ジャッジ時間 3,295 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 85 ms
75,716 KB
testcase_01 AC 83 ms
75,708 KB
testcase_02 AC 82 ms
75,836 KB
testcase_03 AC 82 ms
75,756 KB
testcase_04 AC 83 ms
75,700 KB
testcase_05 AC 82 ms
75,532 KB
testcase_06 AC 82 ms
75,760 KB
testcase_07 AC 84 ms
75,712 KB
testcase_08 AC 83 ms
75,444 KB
testcase_09 AC 87 ms
80,572 KB
testcase_10 AC 90 ms
83,152 KB
testcase_11 AC 94 ms
86,476 KB
testcase_12 AC 100 ms
91,588 KB
testcase_13 AC 100 ms
91,600 KB
testcase_14 AC 104 ms
94,596 KB
testcase_15 AC 113 ms
100,840 KB
testcase_16 AC 126 ms
111,684 KB
testcase_17 AC 85 ms
75,668 KB
testcase_18 AC 84 ms
75,684 KB
testcase_19 AC 83 ms
75,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  N=int(input())
  cnt=0
  d=set()
  for i in range(1,N):
    d.add(i*i)
  for x in range(1,N):
    if N*N-x*x in d:
      cnt+=1
  print(cnt)
  return

main()
0