結果

問題 No.800 四平方定理
ユーザー tempura_pptempura_pp
提出日時 2019-03-14 13:56:29
言語 PyPy3
(7.3.15)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 257 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 118,692 KB
最終ジャッジ日時 2023-09-14 12:09:06
合計ジャッジ時間 6,596 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
115,180 KB
testcase_01 AC 97 ms
115,412 KB
testcase_02 AC 99 ms
115,416 KB
testcase_03 AC 98 ms
115,456 KB
testcase_04 AC 97 ms
115,588 KB
testcase_05 AC 96 ms
115,528 KB
testcase_06 AC 98 ms
115,540 KB
testcase_07 AC 98 ms
115,192 KB
testcase_08 AC 96 ms
115,412 KB
testcase_09 AC 100 ms
115,488 KB
testcase_10 AC 168 ms
115,560 KB
testcase_11 AC 167 ms
115,628 KB
testcase_12 AC 180 ms
115,516 KB
testcase_13 AC 156 ms
115,608 KB
testcase_14 AC 168 ms
115,352 KB
testcase_15 AC 181 ms
115,376 KB
testcase_16 AC 170 ms
115,660 KB
testcase_17 AC 165 ms
115,344 KB
testcase_18 AC 188 ms
115,476 KB
testcase_19 AC 193 ms
115,532 KB
testcase_20 AC 87 ms
110,304 KB
testcase_21 AC 86 ms
110,608 KB
testcase_22 AC 194 ms
115,232 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 85 ms
110,388 KB
testcase_27 AC 86 ms
110,276 KB
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,d=map(int,input().split())
MAX=5000000
cnt1=[0]*MAX
for i in range(1,n+1) :
    for j in range(1,n+1) :
        cnt1[i*i+j*j]+=1
ans=0
for i in range(1,n+1) :
    for j in range(1,n+1) :
        if i*i-j*j+d>0 :
            ans+=cnt1[i*i-j*j+d]
print(ans)
0