結果

問題 No.2375 watasou and hibit's baseball
ユーザー 👑 p-adicp-adic
提出日時 2023-07-08 16:39:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 428 bytes
コンパイル時間 496 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 145,160 KB
最終ジャッジ日時 2023-09-29 18:05:19
合計ジャッジ時間 56,332 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,268 KB
testcase_01 AC 70 ms
71,464 KB
testcase_02 AC 72 ms
71,384 KB
testcase_03 AC 1,709 ms
116,772 KB
testcase_04 WA -
testcase_05 AC 91 ms
76,356 KB
testcase_06 TLE -
testcase_07 AC 70 ms
71,536 KB
testcase_08 WA -
testcase_09 AC 70 ms
71,384 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 TLE -
testcase_13 WA -
testcase_14 AC 70 ms
71,472 KB
testcase_15 AC 800 ms
91,192 KB
testcase_16 AC 562 ms
86,556 KB
testcase_17 TLE -
testcase_18 WA -
testcase_19 AC 70 ms
71,076 KB
testcase_20 WA -
testcase_21 TLE -
testcase_22 AC 71 ms
71,476 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 69 ms
71,320 KB
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 AC 1,474 ms
122,984 KB
権限があれば一括ダウンロードができます

ソースコード

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]
		if (S>>k&1<1)*d:D[S|1<<k][j][k]=d=max(D[S|1<<k][j][k],d+(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