結果

問題 No.800 四平方定理
ユーザー tempura_pptempura_pp
提出日時 2019-03-14 13:52:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 257 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,640 KB
実行使用メモリ 47,260 KB
最終ジャッジ日時 2023-09-14 12:10:14
合計ジャッジ時間 28,429 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
47,096 KB
testcase_01 AC 112 ms
47,212 KB
testcase_02 AC 99 ms
47,168 KB
testcase_03 AC 103 ms
46,860 KB
testcase_04 AC 101 ms
47,048 KB
testcase_05 AC 105 ms
47,236 KB
testcase_06 AC 121 ms
47,104 KB
testcase_07 AC 119 ms
47,088 KB
testcase_08 AC 133 ms
47,212 KB
testcase_09 AC 113 ms
47,096 KB
testcase_10 AC 1,609 ms
47,216 KB
testcase_11 AC 1,813 ms
47,176 KB
testcase_12 AC 1,842 ms
47,156 KB
testcase_13 AC 1,576 ms
47,232 KB
testcase_14 AC 1,637 ms
47,124 KB
testcase_15 AC 1,788 ms
47,096 KB
testcase_16 AC 1,629 ms
47,104 KB
testcase_17 AC 1,607 ms
47,112 KB
testcase_18 AC 1,961 ms
47,120 KB
testcase_19 TLE -
testcase_20 AC 67 ms
47,076 KB
testcase_21 AC 67 ms
47,124 KB
testcase_22 TLE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 68 ms
47,176 KB
testcase_27 AC 67 ms
47,076 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