結果

問題 No.800 四平方定理
ユーザー titiytitiy
提出日時 2019-03-28 13:05:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 234 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 176,584 KB
最終ジャッジ日時 2024-04-20 20:53:16
合計ジャッジ時間 25,682 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
80,128 KB
testcase_01 AC 158 ms
76,364 KB
testcase_02 AC 144 ms
75,520 KB
testcase_03 AC 154 ms
75,760 KB
testcase_04 AC 147 ms
75,432 KB
testcase_05 AC 141 ms
75,836 KB
testcase_06 AC 157 ms
76,596 KB
testcase_07 AC 157 ms
75,964 KB
testcase_08 AC 170 ms
76,844 KB
testcase_09 AC 152 ms
76,632 KB
testcase_10 AC 1,654 ms
165,660 KB
testcase_11 AC 1,735 ms
175,152 KB
testcase_12 TLE -
testcase_13 AC 1,563 ms
169,348 KB
testcase_14 AC 1,681 ms
175,116 KB
testcase_15 AC 1,852 ms
176,584 KB
testcase_16 AC 1,690 ms
176,100 KB
testcase_17 AC 1,629 ms
176,232 KB
testcase_18 AC 1,951 ms
175,720 KB
testcase_19 AC 1,922 ms
176,056 KB
testcase_20 AC 108 ms
73,196 KB
testcase_21 AC 105 ms
73,152 KB
testcase_22 AC 1,901 ms
176,172 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())
cnt=[0]*8000001
ans=0
for i in [i*i-j*j+d for i in range(1,n+1) for j in range(1,n+1)if i*i-j*j+d>0]:
    cnt[i]+=1
for x in [i*i+j*j for i in range(1,n+1)for j in range(1,n+1)]:
    ans+=cnt[x]
print(ans)
0