結果

問題 No.2375 watasou and hibit's baseball
ユーザー 👑 p-adicp-adic
提出日時 2023-07-08 16:58:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,426 ms / 2,000 ms
コード長 411 bytes
コンパイル時間 655 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 124,648 KB
最終ジャッジ日時 2023-09-29 18:25:10
合計ジャッジ時間 25,713 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,392 KB
testcase_01 AC 64 ms
71,420 KB
testcase_02 AC 63 ms
71,384 KB
testcase_03 AC 608 ms
100,036 KB
testcase_04 AC 72 ms
76,376 KB
testcase_05 AC 75 ms
76,328 KB
testcase_06 AC 1,426 ms
124,648 KB
testcase_07 AC 63 ms
71,212 KB
testcase_08 AC 208 ms
83,352 KB
testcase_09 AC 65 ms
71,300 KB
testcase_10 AC 73 ms
76,204 KB
testcase_11 AC 105 ms
79,112 KB
testcase_12 AC 957 ms
122,508 KB
testcase_13 AC 452 ms
97,624 KB
testcase_14 AC 65 ms
71,272 KB
testcase_15 AC 334 ms
84,448 KB
testcase_16 AC 284 ms
82,832 KB
testcase_17 AC 907 ms
121,192 KB
testcase_18 AC 70 ms
76,388 KB
testcase_19 AC 67 ms
71,264 KB
testcase_20 AC 100 ms
79,232 KB
testcase_21 AC 951 ms
121,776 KB
testcase_22 AC 65 ms
71,264 KB
testcase_23 AC 881 ms
118,340 KB
testcase_24 AC 848 ms
118,268 KB
testcase_25 AC 64 ms
71,136 KB
testcase_26 AC 1,095 ms
123,484 KB
testcase_27 AC 1,119 ms
124,448 KB
testcase_28 AC 1,144 ms
124,456 KB
testcase_29 AC 1,165 ms
123,604 KB
testcase_30 AC 1,252 ms
124,196 KB
testcase_31 AC 1,220 ms
124,276 KB
testcase_32 AC 1,249 ms
124,620 KB
testcase_33 AC 1,164 ms
124,072 KB
testcase_34 AC 1,123 ms
123,996 KB
testcase_35 AC 1,232 ms
124,228 KB
testcase_36 AC 1,195 ms
124,252 KB
testcase_37 AC 1,073 ms
122,956 KB
testcase_38 AC 866 ms
118,136 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==1<<i)*(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:
			if 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:D[S|1<<k][j][k],a=d+1,max(a,d+1)
print(a)
0