結果

問題 No.800 四平方定理
ユーザー sho_00sho_00
提出日時 2020-04-09 20:30:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 251 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 82,764 KB
最終ジャッジ日時 2023-10-11 21:27:28
合計ジャッジ時間 26,022 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
8,592 KB
testcase_01 AC 69 ms
9,044 KB
testcase_02 AC 52 ms
8,844 KB
testcase_03 AC 54 ms
8,960 KB
testcase_04 AC 49 ms
8,760 KB
testcase_05 AC 54 ms
9,096 KB
testcase_06 AC 75 ms
9,480 KB
testcase_07 AC 70 ms
9,968 KB
testcase_08 AC 82 ms
11,600 KB
testcase_09 AC 68 ms
9,384 KB
testcase_10 AC 1,614 ms
42,656 KB
testcase_11 AC 1,798 ms
44,652 KB
testcase_12 AC 1,801 ms
46,496 KB
testcase_13 AC 1,612 ms
40,516 KB
testcase_14 AC 1,748 ms
42,800 KB
testcase_15 AC 1,837 ms
46,544 KB
testcase_16 AC 1,709 ms
43,048 KB
testcase_17 AC 1,745 ms
43,036 KB
testcase_18 AC 1,889 ms
50,800 KB
testcase_19 AC 1,941 ms
50,964 KB
testcase_20 AC 15 ms
7,808 KB
testcase_21 AC 16 ms
7,948 KB
testcase_22 AC 1,935 ms
51,004 KB
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D=map(int,input().split())
L=[0]*(D+2*N**2)
cnt=0
for i in range(1,N+1):
  for j in range(1,N+1):
    L[i**2+j**2-1]+=1
for z  in range(1,N+1):
  for w in range(1,N+1):
    A=D+w**2-z**2
    if A<=1:
      pass
    else:
      cnt+=L[A-1]
print(cnt)
0