結果
問題 | No.2182 KODOKU Stone |
ユーザー | MasKoaTS |
提出日時 | 2022-11-30 17:01:06 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,453 bytes |
コンパイル時間 | 453 ms |
コンパイル使用メモリ | 82,224 KB |
実行使用メモリ | 264,324 KB |
最終ジャッジ日時 | 2024-11-14 12:08:13 |
合計ジャッジ時間 | 19,780 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 123 ms
86,328 KB |
testcase_01 | AC | 122 ms
86,436 KB |
testcase_02 | AC | 128 ms
86,964 KB |
testcase_03 | AC | 122 ms
86,404 KB |
testcase_04 | AC | 123 ms
86,484 KB |
testcase_05 | AC | 123 ms
86,624 KB |
testcase_06 | AC | 140 ms
89,040 KB |
testcase_07 | AC | 141 ms
89,180 KB |
testcase_08 | AC | 140 ms
88,900 KB |
testcase_09 | AC | 139 ms
88,896 KB |
testcase_10 | AC | 125 ms
86,204 KB |
testcase_11 | AC | 991 ms
259,576 KB |
testcase_12 | AC | 991 ms
244,764 KB |
testcase_13 | AC | 210 ms
101,956 KB |
testcase_14 | AC | 197 ms
89,860 KB |
testcase_15 | AC | 1,014 ms
221,316 KB |
testcase_16 | AC | 1,003 ms
264,324 KB |
testcase_17 | AC | 187 ms
101,800 KB |
testcase_18 | AC | 896 ms
239,504 KB |
testcase_19 | AC | 531 ms
148,924 KB |
testcase_20 | AC | 776 ms
206,108 KB |
testcase_21 | AC | 238 ms
91,596 KB |
testcase_22 | AC | 228 ms
90,120 KB |
testcase_23 | WA | - |
testcase_24 | AC | 362 ms
104,124 KB |
testcase_25 | AC | 183 ms
89,868 KB |
testcase_26 | AC | 176 ms
89,516 KB |
testcase_27 | AC | 177 ms
89,808 KB |
testcase_28 | AC | 722 ms
192,912 KB |
testcase_29 | AC | 862 ms
222,444 KB |
testcase_30 | AC | 951 ms
244,988 KB |
testcase_31 | AC | 729 ms
188,032 KB |
testcase_32 | AC | 709 ms
182,336 KB |
testcase_33 | AC | 800 ms
213,616 KB |
testcase_34 | AC | 289 ms
95,420 KB |
testcase_35 | AC | 812 ms
211,832 KB |
testcase_36 | AC | 271 ms
96,408 KB |
testcase_37 | AC | 940 ms
242,528 KB |
testcase_38 | WA | - |
testcase_39 | AC | 121 ms
85,880 KB |
ソースコード
import itertools as iter import collections as coll import heapq as hq import bisect as bis from decimal import Decimal as dec from functools import cmp_to_key import math import sys #import pypyjit #pypyjit.set_param('max_unroll_recursion=-1') sys.setrecursionlimit(10 ** 6) inp = sys.stdin.readline input = lambda : inp().rstrip() getN = lambda : int(inp()) getNs = lambda : map(int, inp().split()) getList = lambda :list(map(int, inp().split())) getStrs = lambda n : [input() for _ in [0] * n] def yexit(): print("Yes"); exit(0) def nexit(): print("No"); exit(0) pi = 3.141592653589793 mod = 1000000007 MOD = 998244353 INF = 4611686018427387903 dx = [1, 0, -1, 0]; dy = [0, 1, 0, -1] #di = coll.defaultdict(int) """ Main Code """ N = getN() K = getList() T = [0]*N A = [[] for _ in [0]*N] for i in range(N): T[i] = getN() A[i] = getList() def check(m): s = [0] * N P_tmp = [] Q_tmp = [] for i in range(N): s[i] = sum((k >= m) for k in A[i]) if(s[i] != len(A[i])): P_tmp.append(s[i]) else: Q_tmp.append(s[i]) P = coll.deque(sorted(P_tmp)) Q = coll.deque(sorted(Q_tmp)) for i, k in enumerate(K[::-1]): p = P[-1] if(P) else -1 q = Q[-1] if(Q) else -1 if(max(p,q) >= k): return True elif(p == k - 1 and i < N - 1): P.pop() elif(q != -1): Q.popleft() else: return False return True ok = 0 ng = 10 ** 9 + 1 while(ng - ok > 1): mid = (ok + ng) >> 1 if(check(mid)): ok = mid else: ng = mid print(ok)