結果

問題 No.2182 KODOKU Stone
ユーザー MasKoaTSMasKoaTS
提出日時 2022-08-20 16:58:20
言語 PyPy3
(7.3.13)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 658 bytes
コンパイル時間 553 ms
コンパイル使用メモリ 87,288 KB
実行使用メモリ 175,776 KB
最終ジャッジ日時 2023-08-09 06:10:30
合計ジャッジ時間 28,924 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,192 KB
testcase_01 AC 71 ms
71,452 KB
testcase_02 AC 70 ms
71,388 KB
testcase_03 AC 70 ms
71,524 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 82 ms
76,080 KB
testcase_07 WA -
testcase_08 AC 85 ms
75,960 KB
testcase_09 AC 86 ms
76,124 KB
testcase_10 AC 71 ms
71,204 KB
testcase_11 AC 1,060 ms
168,048 KB
testcase_12 AC 1,467 ms
163,568 KB
testcase_13 AC 163 ms
102,136 KB
testcase_14 WA -
testcase_15 AC 1,111 ms
171,140 KB
testcase_16 AC 1,156 ms
175,776 KB
testcase_17 AC 148 ms
98,088 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 179 ms
85,568 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 133 ms
78,448 KB
testcase_26 AC 116 ms
78,168 KB
testcase_27 AC 115 ms
78,288 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 1,259 ms
133,988 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 71 ms
71,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N = int(input())
K = list(map(int, input().split()))
T = [0] * N
A = [[] for _ in [0] * N]
st = set([])
for i in range(N):
	T[i] = int(input())
	A[i] = list(map(int, input().split()))
	st |= set(A[i])
Alis = sorted(st)

ok = 0
ng = len(Alis)

def check():
	B = sorted([(sum((k >= md) for k in lis), len(lis)) for lis in A])
	for k in K[::-1]:
		if(B[-1][0] >= k):
			return True
		elif(len(B) == 1):
			return (B[-1][0] == B[-1][1])
		elif(B[-1][0] < k-1):
			break
		B.pop()
	return False

while(ng - ok > 1):
	mid = (ok + ng) >> 1
	md = Alis[mid]
	if check():
		ok = mid
	else:
		ng = mid

ans = Alis[ok]
print(ans)	
0