結果

問題 No.1361 [Zelkova 4th Tune *] QUADRUPLE-SEQUENCEの詩
ユーザー KudeKude
提出日時 2021-01-22 23:48:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,388 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 152,248 KB
最終ジャッジ日時 2023-08-27 23:36:56
合計ジャッジ時間 29,943 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,496 KB
testcase_01 AC 68 ms
71,516 KB
testcase_02 AC 75 ms
75,784 KB
testcase_03 AC 77 ms
76,240 KB
testcase_04 WA -
testcase_05 AC 70 ms
71,368 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
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 AC 611 ms
149,216 KB
testcase_49 AC 458 ms
148,612 KB
testcase_50 AC 623 ms
148,840 KB
testcase_51 AC 550 ms
148,968 KB
testcase_52 AC 576 ms
149,112 KB
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 AC 343 ms
123,716 KB
testcase_59 AC 340 ms
123,648 KB
testcase_60 AC 660 ms
123,700 KB
testcase_61 AC 657 ms
123,760 KB
testcase_62 AC 652 ms
123,404 KB
testcase_63 AC 135 ms
101,480 KB
testcase_64 AC 135 ms
101,704 KB
testcase_65 AC 136 ms
101,856 KB
testcase_66 AC 133 ms
101,732 KB
testcase_67 AC 137 ms
101,856 KB
testcase_68 AC 67 ms
71,544 KB
testcase_69 AC 69 ms
71,492 KB
testcase_70 AC 67 ms
71,252 KB
testcase_71 AC 68 ms
71,408 KB
testcase_72 AC 68 ms
71,588 KB
testcase_73 AC 66 ms
71,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product
k, l, m, n, s = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
D = list(map(int, input().split()))
a = sorted(x * y for x, y in product(A, B))
b = sorted(x * y for x, y in product(C, D))
na = list(filter(lambda x: x < 0, a))
pa = list(filter(lambda x: x > 0, a))
za = sum(x == 0 for x in a)
s -= 1
left = -10 ** 18
right = 10 ** 18
while right - left > 1:
    c = (right + left) // 2
    cnt = 0
    i = 0
    for x in na:
        while i < len(b) and b[i] * x >= c:
            i += 1
        cnt += len(b) - i
    if c > 0:
        cnt += za * len(b)
    i = len(b)
    for x in pa:
        while i - 1 >= 0 and b[i - 1] * x >= c:
            i -= 1
        cnt += i
    if cnt <= s:
        left = c
    else:
        right = c
ans = right - 1
print(ans)
if ans == 0:
    p = [A[0], B[0], C[0], D[0]]
    for i in range(4):
        t = [A, B, C, D][i]
        for x in t:
            if x == 0:
                p[i] = x
    print(*p)
    exit()
bset = set(b)
for x in a:
    if x == 0 or ans % x:
        continue
    if ans // x in b:
        y = ans // x
        break
ans = []
for i, j in product(A, B):
    if i * j == x:
        ans += [i, j]
        break
for i, j in product(C, D):
    if i * j == y:
        ans += [i, j]
        break
assert(ans)
print(*ans)
0