結果

問題 No.2375 watasou and hibit's baseball
ユーザー 👑 p-adicp-adic
提出日時 2023-07-08 16:29:58
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 429 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 133,944 KB
最終ジャッジ日時 2023-09-29 17:55:10
合計ジャッジ時間 4,355 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
75,504 KB
testcase_01 AC 73 ms
71,248 KB
testcase_02 AC 76 ms
71,292 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
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 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

R=range
def J():
	return map(int,input().split())
N,A,B=J()
L=R(N)
Z=[list(J())for i in L]
P=R(1<<N)
D=[[[S>>i==1and i==j for j in L]for i in L]for S in P]
a=1
for S in P:
	for h in R(N**3):
		i,j,k=h%N,h//N%N,h//N**2
		d,v,w=D[S][i][j],Z[j],Z[k]
		D[S|1<<k][j][k]=d=max(D[S|1<<k][j][k],d+(S>>k&1<1)*(d and abs(w[0]-Z[i][0])+abs(w[1]-Z[i][1])+(i!=j)*(abs(w[0]-v[0])+abs(w[1]-v[1]))>=A or abs(w[2]-v[2])>=B))
		a=max(a,d)
print(a)
0