結果

問題 No.1361 [Zelkova 4th Tune *] QUADRUPLE-SEQUENCEの詩
ユーザー convexineqconvexineq
提出日時 2021-01-23 17:44:35
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 1,312 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 191,352 KB
最終ジャッジ日時 2023-08-30 02:17:59
合計ジャッジ時間 38,121 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,208 KB
testcase_01 AC 73 ms
70,868 KB
testcase_02 AC 82 ms
75,920 KB
testcase_03 AC 84 ms
75,700 KB
testcase_04 AC 76 ms
71,120 KB
testcase_05 AC 76 ms
71,128 KB
testcase_06 AC 76 ms
71,204 KB
testcase_07 AC 75 ms
70,980 KB
testcase_08 AC 98 ms
76,568 KB
testcase_09 AC 95 ms
75,776 KB
testcase_10 AC 105 ms
76,756 KB
testcase_11 AC 110 ms
77,008 KB
testcase_12 AC 98 ms
76,484 KB
testcase_13 AC 108 ms
76,868 KB
testcase_14 AC 98 ms
76,296 KB
testcase_15 AC 117 ms
77,328 KB
testcase_16 AC 98 ms
76,568 KB
testcase_17 AC 108 ms
76,500 KB
testcase_18 AC 168 ms
78,432 KB
testcase_19 AC 140 ms
77,360 KB
testcase_20 AC 171 ms
78,140 KB
testcase_21 AC 136 ms
78,480 KB
testcase_22 AC 145 ms
78,452 KB
testcase_23 AC 161 ms
79,252 KB
testcase_24 AC 160 ms
80,464 KB
testcase_25 AC 161 ms
79,632 KB
testcase_26 AC 171 ms
79,344 KB
testcase_27 AC 148 ms
77,440 KB
testcase_28 AC 512 ms
106,324 KB
testcase_29 AC 449 ms
98,660 KB
testcase_30 AC 422 ms
92,672 KB
testcase_31 AC 513 ms
101,748 KB
testcase_32 AC 535 ms
131,052 KB
testcase_33 AC 398 ms
92,716 KB
testcase_34 AC 571 ms
116,256 KB
testcase_35 AC 625 ms
104,040 KB
testcase_36 AC 867 ms
131,684 KB
testcase_37 AC 297 ms
98,496 KB
testcase_38 AC 518 ms
98,756 KB
testcase_39 AC 354 ms
89,868 KB
testcase_40 AC 424 ms
96,872 KB
testcase_41 AC 552 ms
112,104 KB
testcase_42 AC 842 ms
118,044 KB
testcase_43 AC 540 ms
104,520 KB
testcase_44 AC 649 ms
106,408 KB
testcase_45 AC 554 ms
101,416 KB
testcase_46 AC 580 ms
120,920 KB
testcase_47 AC 364 ms
98,268 KB
testcase_48 AC 817 ms
191,352 KB
testcase_49 AC 685 ms
191,304 KB
testcase_50 AC 819 ms
191,296 KB
testcase_51 AC 733 ms
191,120 KB
testcase_52 AC 784 ms
191,252 KB
testcase_53 AC 1,096 ms
143,204 KB
testcase_54 AC 1,074 ms
143,112 KB
testcase_55 AC 1,107 ms
143,192 KB
testcase_56 AC 1,073 ms
143,080 KB
testcase_57 AC 811 ms
143,200 KB
testcase_58 AC 695 ms
130,352 KB
testcase_59 AC 695 ms
130,548 KB
testcase_60 AC 705 ms
130,276 KB
testcase_61 AC 705 ms
130,496 KB
testcase_62 AC 703 ms
130,548 KB
testcase_63 AC 282 ms
127,212 KB
testcase_64 AC 283 ms
127,464 KB
testcase_65 AC 282 ms
127,764 KB
testcase_66 AC 280 ms
127,232 KB
testcase_67 AC 282 ms
127,400 KB
testcase_68 AC 74 ms
71,264 KB
testcase_69 AC 74 ms
71,148 KB
testcase_70 AC 73 ms
71,208 KB
testcase_71 AC 75 ms
71,240 KB
testcase_72 AC 73 ms
71,164 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)
scd = set(cd)
if ok==0:
    if 0 in cd:
        x,y = ab[1],0
    else:
        x,y = 0,cd[1]
else:
    for x in ab:
        if x and ok%x==0 and ok//x in scd:
            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