結果

問題 No.2375 watasou and hibit's baseball
ユーザー 👑 p-adicp-adic
提出日時 2023-07-08 16:35:59
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 433 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 124,308 KB
最終ジャッジ日時 2023-09-29 18:00:57
合計ジャッジ時間 4,810 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,660 KB
testcase_01 AC 69 ms
71,428 KB
testcase_02 AC 72 ms
71,188 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>>(h%N)==1and h%N==h//N for h in R(N*N)]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][h%N**2],Z[j],Z[k]
		D[S|1<<k][h//N]=d=max(D[S|1<<k][h//N],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