結果

問題 No.1361 [Zelkova 4th Tune *] QUADRUPLE-SEQUENCEの詩
ユーザー convexineqconvexineq
提出日時 2021-01-23 17:06:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,188 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 191,820 KB
最終ジャッジ日時 2023-08-30 01:38:32
合計ジャッジ時間 38,303 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,620 KB
testcase_01 AC 72 ms
71,456 KB
testcase_02 AC 80 ms
76,080 KB
testcase_03 AC 84 ms
76,160 KB
testcase_04 AC 72 ms
71,112 KB
testcase_05 AC 73 ms
71,304 KB
testcase_06 AC 72 ms
71,520 KB
testcase_07 AC 72 ms
71,532 KB
testcase_08 WA -
testcase_09 AC 93 ms
76,240 KB
testcase_10 AC 105 ms
76,780 KB
testcase_11 AC 101 ms
76,756 KB
testcase_12 WA -
testcase_13 AC 105 ms
77,096 KB
testcase_14 AC 95 ms
76,180 KB
testcase_15 WA -
testcase_16 AC 97 ms
76,864 KB
testcase_17 AC 104 ms
76,868 KB
testcase_18 AC 165 ms
78,872 KB
testcase_19 AC 137 ms
77,660 KB
testcase_20 AC 165 ms
78,220 KB
testcase_21 AC 131 ms
78,916 KB
testcase_22 WA -
testcase_23 AC 157 ms
79,688 KB
testcase_24 AC 158 ms
80,464 KB
testcase_25 AC 157 ms
79,892 KB
testcase_26 AC 167 ms
79,612 KB
testcase_27 AC 145 ms
78,020 KB
testcase_28 WA -
testcase_29 AC 441 ms
98,644 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 293 ms
98,800 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 AC 705 ms
130,636 KB
testcase_59 AC 689 ms
130,932 KB
testcase_60 AC 700 ms
130,856 KB
testcase_61 AC 702 ms
130,552 KB
testcase_62 AC 705 ms
130,692 KB
testcase_63 RE -
testcase_64 RE -
testcase_65 RE -
testcase_66 RE -
testcase_67 RE -
testcase_68 RE -
testcase_69 RE -
testcase_70 AC 74 ms
71,300 KB
testcase_71 AC 74 ms
71,432 KB
testcase_72 AC 73 ms
71,372 KB
testcase_73 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

K,L,M,N,s = map(int,input().split())
*a, = map(int,input().split())
*b, = map(int,input().split())
*c, = map(int,input().split())
*d, = map(int,input().split())

ab = [i*j for i in a for j in b]
cd = [i*j for i in c for j in d]
ab.sort()
cd.sort()
from bisect import bisect_left
Lab = bisect_left(ab,0)
Lcd = bisect_left(cd,0)
ok = INF = 10**18
ng = -INF
KL,MN = K*L, M*N
while ok-ng > 1:
    mid = (ok+ng)//2
    v = r = 0
    for i in range(Lab)[::-1]:
        while r < Lcd and ab[i]*cd[r] > mid:
            r += 1
        v += Lcd-r
    r = Lcd
    for i in range(Lab):
        while r < MN and ab[i]*cd[r] > mid:
            r += 1
        v += MN-r
    r = 0        
    for i in range(Lab,KL):
        while r < Lcd and ab[i]*cd[r] <= mid:
            r += 1
        v += r
    r = Lcd
    for i in range(Lab,KL)[::-1]:
        while r < MN and ab[i]*cd[r] <= mid:
            r += 1
        v += r-Lcd
    if v >= s: ok = mid
    else: ng = mid

print(ok)
cd = set(cd)
for x in ab:
    if ok//x in cd:
        y = ok//x
        break
r = [0]*4
for i in a:
    for j in b:
        if i*j==x: r[0],r[1] = i,j
for i in c:
    for j in d:
        if i*j==y: r[2],r[3] = i,j
print(*r)
0