結果

問題 No.800 四平方定理
ユーザー DrDrpilotDrDrpilot
提出日時 2022-06-21 17:35:11
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 334 bytes
コンパイル時間 439 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 608,820 KB
最終ジャッジ日時 2024-04-22 12:17:03
合計ジャッジ時間 5,525 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
100,352 KB
testcase_01 AC 142 ms
120,960 KB
testcase_02 AC 119 ms
105,856 KB
testcase_03 AC 127 ms
110,208 KB
testcase_04 AC 118 ms
101,888 KB
testcase_05 AC 124 ms
105,856 KB
testcase_06 AC 157 ms
131,840 KB
testcase_07 AC 136 ms
113,536 KB
testcase_08 AC 158 ms
133,888 KB
testcase_09 AC 143 ms
123,008 KB
testcase_10 MLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
n,d=map(int,input().split())
cnt1=defaultdict(int)
cnt2=defaultdict(int)
for x in range(1,n+1):
    for y in range(1,n+1):
        cnt1[x**2+y**2]+=1
for z in range(1,n+1):
    for w in range(1,n+1):
        cnt2[w**2-z**2+d]+=1
ans=0
for i in range(1,2*n**2+1):
    ans+=cnt1[i]*cnt2[i]
print(ans)
0