結果

問題 No.1361 [Zelkova 4th Tune *] QUADRUPLE-SEQUENCEの詩
コンテスト
ユーザー 👑 Kazun
提出日時 2020-09-07 00:35:28
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
MLE  
実行時間 -
コード長 588 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 65 ms
コンパイル使用メモリ 81,372 KB
実行使用メモリ 1,332,528 KB
最終ジャッジ日時 2026-10-08 16:57:39
合計ジャッジ時間 10,877 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 MLE * 2 -- * 54
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def h(A,B,x):
    G=set(B)
    b=B[0]

    for a in A:
        if a==0:
            if x==0:
                return (0,b)
        elif (x%a==0) and (x//a in G):
            return (a,x//a)
    return None

#Greedy解法
K,L,M,N,P=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()))

E=[a*b*c*d for a in A for b in B for c in C for d in D]
E.sort()

J=E[P-1]
U=[a*b for a in A for b in B]
V=[c*d for c in C for d in D]

p,q=h(U,V,J)
a,b=h(A,B,p)
c,d=h(C,D,q)

print(J)
print(a,b,c,d)
0