結果

問題 No.2375 watasou and hibit's baseball
ユーザー sasa8uyauyasasa8uyauya
提出日時 2024-03-23 11:36:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 688 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 125,080 KB
最終ジャッジ日時 2024-03-23 11:37:05
合計ジャッジ時間 15,083 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 WA -
testcase_02 AC 37 ms
53,460 KB
testcase_03 AC 473 ms
100,116 KB
testcase_04 AC 43 ms
59,836 KB
testcase_05 AC 44 ms
59,580 KB
testcase_06 AC 1,002 ms
125,008 KB
testcase_07 AC 37 ms
53,460 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 350 ms
121,268 KB
testcase_13 AC 141 ms
95,268 KB
testcase_14 AC 37 ms
53,460 KB
testcase_15 AC 366 ms
84,344 KB
testcase_16 AC 327 ms
81,484 KB
testcase_17 AC 214 ms
119,068 KB
testcase_18 AC 38 ms
53,460 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 224 ms
119,580 KB
testcase_22 AC 38 ms
53,460 KB
testcase_23 WA -
testcase_24 AC 156 ms
116,764 KB
testcase_25 AC 38 ms
53,460 KB
testcase_26 AC 592 ms
124,548 KB
testcase_27 AC 577 ms
124,416 KB
testcase_28 AC 625 ms
124,332 KB
testcase_29 AC 590 ms
123,768 KB
testcase_30 AC 664 ms
124,028 KB
testcase_31 AC 670 ms
125,080 KB
testcase_32 AC 726 ms
124,584 KB
testcase_33 AC 576 ms
124,352 KB
testcase_34 AC 582 ms
124,040 KB
testcase_35 AC 689 ms
124,836 KB
testcase_36 AC 590 ms
123,400 KB
testcase_37 AC 442 ms
122,084 KB
testcase_38 AC 166 ms
116,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,a,b=map(int,input().split())
ball=[tuple(map(int,input().split())) for i in range(n)]
g=0
q=[[[0]*n for j in range(n)] for i in range(1<<n)]
for i in range(n):
	for j in range(n):
		if i!=j:
			x1,y1,k1=ball[i]
			x2,y2,k2=ball[j]
			if a<=abs(x1-x2)+abs(y1-y2) or b<=abs(k1-k2):
				q[(1<<i)+(1<<j)][i][j]=2
				g=2
for p in range(1<<n):
	for i in range(n):
		for j in range(n):
			if q[p][i][j]>0:
				x1,y1,k1=ball[i]
				x2,y2,k2=ball[j]
				for k in range(n):
					if (p>>k)&1==0:
						x3,y3,k3=ball[k]
						if a<=abs(x3-x1)+abs(y3-y1)+abs(x3-x2)+abs(y3-y2) or b<=abs(k3-k1):
							q[p+(1<<k)][k][i]=max(q[p+(1<<k)][k][i],q[p][i][j]+1)
							g=max(g,q[p+(1<<k)][k][i])
print(g)
0