結果
問題 | No.2453 Seat Allocation |
ユーザー | mkawa2 |
提出日時 | 2023-09-09 02:09:34 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 357 ms / 2,000 ms |
コード長 | 1,030 bytes |
コンパイル時間 | 282 ms |
コンパイル使用メモリ | 87,032 KB |
実行使用メモリ | 116,208 KB |
最終ジャッジ日時 | 2023-09-09 02:09:42 |
合計ジャッジ時間 | 7,224 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 101 ms
71,416 KB |
testcase_01 | AC | 76 ms
71,396 KB |
testcase_02 | AC | 77 ms
71,328 KB |
testcase_03 | AC | 75 ms
71,440 KB |
testcase_04 | AC | 76 ms
71,536 KB |
testcase_05 | AC | 345 ms
116,208 KB |
testcase_06 | AC | 174 ms
90,552 KB |
testcase_07 | AC | 197 ms
98,032 KB |
testcase_08 | AC | 154 ms
80,040 KB |
testcase_09 | AC | 357 ms
98,252 KB |
testcase_10 | AC | 330 ms
97,176 KB |
testcase_11 | AC | 357 ms
97,564 KB |
testcase_12 | AC | 201 ms
90,528 KB |
testcase_13 | AC | 221 ms
90,716 KB |
testcase_14 | AC | 155 ms
90,280 KB |
testcase_15 | AC | 260 ms
90,776 KB |
testcase_16 | AC | 280 ms
90,152 KB |
testcase_17 | AC | 66 ms
71,304 KB |
testcase_18 | AC | 260 ms
95,656 KB |
testcase_19 | AC | 282 ms
98,200 KB |
testcase_20 | AC | 192 ms
85,288 KB |
testcase_21 | AC | 214 ms
86,764 KB |
testcase_22 | AC | 244 ms
94,468 KB |
testcase_23 | AC | 67 ms
71,552 KB |
testcase_24 | AC | 66 ms
71,600 KB |
ソースコード
import sys # sys.setrecursionlimit(200005) # sys.set_int_max_str_digits(1000005) int1 = lambda x: int(x)-1 pDB = lambda *x: print(*x, end="\n", file=sys.stderr) p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr) def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] # dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] inf = -1-(-1 << 63) # md = 10**9+7 md = 998244353 from heapq import * C=10**20 n,m=LI() aa=LI() bb=LI() jj=[0]*n hp=[] for i in range(n): heappush(hp,(bb[0]*C//aa[i],i)) ans=[] for _ in range(m): _,i=heappop(hp) ans.append(i+1) jj[i]+=1 j = jj[i] if j<m:heappush(hp,(bb[j]*C//aa[i],i)) print(*ans,sep="\n")