結果
問題 | No.2182 KODOKU Stone |
ユーザー | Shirotsume |
提出日時 | 2022-09-21 01:18:24 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,369 bytes |
コンパイル時間 | 249 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 260,408 KB |
最終ジャッジ日時 | 2024-04-26 21:05:41 |
合計ジャッジ時間 | 8,844 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 43 ms
57,600 KB |
testcase_01 | AC | 41 ms
52,352 KB |
testcase_02 | AC | 41 ms
52,096 KB |
testcase_03 | AC | 40 ms
52,352 KB |
testcase_04 | AC | 40 ms
52,224 KB |
testcase_05 | AC | 40 ms
52,224 KB |
testcase_06 | AC | 41 ms
52,864 KB |
testcase_07 | AC | 42 ms
52,608 KB |
testcase_08 | AC | 41 ms
52,480 KB |
testcase_09 | AC | 41 ms
52,480 KB |
testcase_10 | WA | - |
testcase_11 | AC | 447 ms
260,408 KB |
testcase_12 | RE | - |
testcase_13 | AC | 84 ms
82,048 KB |
testcase_14 | AC | 96 ms
76,672 KB |
testcase_15 | RE | - |
testcase_16 | AC | 519 ms
260,148 KB |
testcase_17 | WA | - |
testcase_18 | AC | 614 ms
251,252 KB |
testcase_19 | AC | 267 ms
153,932 KB |
testcase_20 | AC | 629 ms
237,360 KB |
testcase_21 | AC | 130 ms
77,696 KB |
testcase_22 | AC | 87 ms
76,288 KB |
testcase_23 | TLE | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
ソースコード
import sys input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 63 - 1 mod = 998244353 n = ii() k = [i - 1 for i in li()][::-1] a = [] for _ in range(n): _ = ii() a.append(list(sorted(li(), reverse=True))) def check(x, s, ix): for i in s: if len(a[i]) > k[ix] and a[i][k[ix]] >= x: return True if len(a[i]) - 1 > k[ix] and k[ix] - 1 >= 0 and a[i][k[ix] - 1] >= x and ix + 1 < len(k): s.discard(i) ix += 1 p = check(x, s, ix) ix -= 1 s.add(i) if p: return True if len(a[i]) == k[ix] and a[i][min(len(a[i]) - 1, k[ix])] >= x: s.discard(i) ix += 1 p = check(a[i][min(len(a[i]) - 1, k[ix])], s, ix) s.add(i) ix -= 1 if p: return True if len(a[i]) < k[ix] and a[i][min(len(a[i]) - 1, k[ix])] >= x: s.discard(i) ix += 1 p = check(x, s, ix) s.add(i) ix -= 1 if p: return True return False ok = 0 ng = 10 ** 9 + 1 while abs(ok - ng) > 1: mid = (ok + ng) // 2 if check(mid, set(range(n)), 0): ok = mid else: ng = mid print(ok)