結果

問題 No.800 四平方定理
ユーザー sho_00sho_00
提出日時 2020-04-09 20:30:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 258 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 146,860 KB
最終ジャッジ日時 2023-10-11 21:27:36
合計ジャッジ時間 7,055 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
76,692 KB
testcase_01 AC 86 ms
77,424 KB
testcase_02 AC 85 ms
77,108 KB
testcase_03 AC 87 ms
77,344 KB
testcase_04 AC 87 ms
77,108 KB
testcase_05 AC 83 ms
77,300 KB
testcase_06 AC 84 ms
77,476 KB
testcase_07 AC 85 ms
78,356 KB
testcase_08 AC 84 ms
79,928 KB
testcase_09 AC 85 ms
77,400 KB
testcase_10 AC 162 ms
110,996 KB
testcase_11 AC 175 ms
113,052 KB
testcase_12 AC 176 ms
114,996 KB
testcase_13 AC 167 ms
109,016 KB
testcase_14 AC 167 ms
111,356 KB
testcase_15 AC 177 ms
115,088 KB
testcase_16 AC 168 ms
111,376 KB
testcase_17 AC 168 ms
111,664 KB
testcase_18 AC 177 ms
119,244 KB
testcase_19 AC 176 ms
119,416 KB
testcase_20 AC 75 ms
71,172 KB
testcase_21 AC 73 ms
71,456 KB
testcase_22 AC 176 ms
119,364 KB
testcase_23 AC 258 ms
146,860 KB
testcase_24 AC 239 ms
139,004 KB
testcase_25 AC 255 ms
146,232 KB
testcase_26 AC 73 ms
71,116 KB
testcase_27 AC 76 ms
79,176 KB
testcase_28 AC 243 ms
138,820 KB
testcase_29 AC 252 ms
142,764 KB
testcase_30 AC 242 ms
138,712 KB
testcase_31 AC 234 ms
134,324 KB
testcase_32 AC 245 ms
139,496 KB
権限があれば一括ダウンロードができます

ソースコード

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