結果
問題 | No.1361 [Zelkova 4th Tune *] QUADRUPLE-SEQUENCEの詩 |
ユーザー | convexineq |
提出日時 | 2021-01-23 17:26:17 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,297 bytes |
コンパイル時間 | 130 ms |
コンパイル使用メモリ | 82,200 KB |
実行使用メモリ | 187,392 KB |
最終ジャッジ日時 | 2024-06-10 01:09:39 |
合計ジャッジ時間 | 29,105 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 39 ms
52,864 KB |
testcase_01 | AC | 36 ms
52,864 KB |
testcase_02 | AC | 45 ms
61,056 KB |
testcase_03 | AC | 49 ms
61,568 KB |
testcase_04 | AC | 37 ms
52,992 KB |
testcase_05 | AC | 36 ms
52,736 KB |
testcase_06 | AC | 38 ms
53,120 KB |
testcase_07 | AC | 38 ms
53,248 KB |
testcase_08 | WA | - |
testcase_09 | AC | 65 ms
66,304 KB |
testcase_10 | AC | 72 ms
71,552 KB |
testcase_11 | AC | 74 ms
71,552 KB |
testcase_12 | WA | - |
testcase_13 | AC | 74 ms
71,808 KB |
testcase_14 | AC | 64 ms
67,968 KB |
testcase_15 | WA | - |
testcase_16 | AC | 62 ms
67,328 KB |
testcase_17 | AC | 73 ms
71,424 KB |
testcase_18 | AC | 130 ms
78,052 KB |
testcase_19 | AC | 106 ms
76,440 KB |
testcase_20 | AC | 132 ms
77,056 KB |
testcase_21 | AC | 101 ms
77,284 KB |
testcase_22 | WA | - |
testcase_23 | AC | 122 ms
78,500 KB |
testcase_24 | AC | 125 ms
79,180 KB |
testcase_25 | AC | 123 ms
78,860 KB |
testcase_26 | AC | 132 ms
78,428 KB |
testcase_27 | AC | 111 ms
76,632 KB |
testcase_28 | WA | - |
testcase_29 | AC | 376 ms
97,496 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 | 246 ms
96,900 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 | 602 ms
129,536 KB |
testcase_59 | AC | 599 ms
129,536 KB |
testcase_60 | AC | 623 ms
129,664 KB |
testcase_61 | AC | 612 ms
129,408 KB |
testcase_62 | AC | 613 ms
129,920 KB |
testcase_63 | AC | 228 ms
118,784 KB |
testcase_64 | AC | 232 ms
118,784 KB |
testcase_65 | AC | 229 ms
119,424 KB |
testcase_66 | AC | 231 ms
119,040 KB |
testcase_67 | AC | 234 ms
118,912 KB |
testcase_68 | RE | - |
testcase_69 | RE | - |
testcase_70 | AC | 35 ms
52,736 KB |
testcase_71 | AC | 36 ms
52,992 KB |
testcase_72 | AC | 35 ms
52,736 KB |
testcase_73 | RE | - |
ソースコード
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) 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 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)