結果

問題 No.800 四平方定理
ユーザー titiytitiy
提出日時 2019-03-28 13:14:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 222 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 260,112 KB
最終ジャッジ日時 2024-04-20 21:08:42
合計ジャッジ時間 35,928 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
74,716 KB
testcase_01 AC 146 ms
76,508 KB
testcase_02 AC 140 ms
75,432 KB
testcase_03 AC 135 ms
75,772 KB
testcase_04 AC 134 ms
75,320 KB
testcase_05 AC 140 ms
75,720 KB
testcase_06 AC 148 ms
76,728 KB
testcase_07 AC 147 ms
75,900 KB
testcase_08 AC 159 ms
76,692 KB
testcase_09 AC 144 ms
76,528 KB
testcase_10 AC 1,186 ms
165,568 KB
testcase_11 AC 1,311 ms
175,316 KB
testcase_12 AC 1,337 ms
173,796 KB
testcase_13 AC 1,115 ms
169,232 KB
testcase_14 AC 1,249 ms
175,156 KB
testcase_15 AC 1,286 ms
174,584 KB
testcase_16 AC 1,203 ms
176,140 KB
testcase_17 AC 1,249 ms
176,204 KB
testcase_18 AC 1,456 ms
175,780 KB
testcase_19 AC 1,462 ms
175,896 KB
testcase_20 AC 111 ms
73,216 KB
testcase_21 AC 110 ms
73,048 KB
testcase_22 AC 1,481 ms
176,280 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 113 ms
73,216 KB
testcase_27 AC 111 ms
73,092 KB
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,d=map(int,input().split())
cnt=[0]*8000001
ans=0
xyz=[i*i for i in range(1,n+1)]
for I in [i-j+d for i in xyz for j in xyz if i-j+d>0]:
    cnt[I]+=1
for x in [i+j for i in xyz for j in xyz]:
    ans+=cnt[x]
print(ans)

0