結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,496 KB
testcase_01 AC 68 ms
71,288 KB
testcase_02 AC 68 ms
71,412 KB
testcase_03 AC 624 ms
100,464 KB
testcase_04 AC 72 ms
76,396 KB
testcase_05 AC 72 ms
76,592 KB
testcase_06 AC 1,441 ms
124,928 KB
testcase_07 AC 67 ms
71,056 KB
testcase_08 AC 216 ms
83,672 KB
testcase_09 AC 64 ms
71,292 KB
testcase_10 AC 68 ms
76,304 KB
testcase_11 AC 111 ms
79,196 KB
testcase_12 AC 958 ms
122,956 KB
testcase_13 AC 467 ms
97,292 KB
testcase_14 AC 67 ms
71,320 KB
testcase_15 AC 327 ms
84,628 KB
testcase_16 AC 289 ms
82,756 KB
testcase_17 AC 897 ms
121,484 KB
testcase_18 AC 71 ms
76,300 KB
testcase_19 AC 63 ms
71,200 KB
testcase_20 AC 107 ms
79,464 KB
testcase_21 AC 947 ms
121,788 KB
testcase_22 AC 67 ms
71,396 KB
testcase_23 AC 869 ms
118,464 KB
testcase_24 AC 851 ms
118,256 KB
testcase_25 AC 64 ms
71,448 KB
testcase_26 AC 1,107 ms
123,844 KB
testcase_27 AC 1,130 ms
124,600 KB
testcase_28 AC 1,146 ms
124,224 KB
testcase_29 AC 1,137 ms
123,832 KB
testcase_30 AC 1,197 ms
124,756 KB
testcase_31 AC 1,205 ms
124,244 KB
testcase_32 AC 1,250 ms
124,572 KB
testcase_33 AC 1,165 ms
123,976 KB
testcase_34 AC 1,124 ms
124,128 KB
testcase_35 AC 1,216 ms
124,232 KB
testcase_36 AC 1,151 ms
124,380 KB
testcase_37 AC 1,065 ms
122,900 KB
testcase_38 AC 853 ms
118,152 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 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):D[S|1<<k][j][k],a=d+1,max(a,d+1)
print(a)
0