結果
問題 | No.1361 [Zelkova 4th Tune *] QUADRUPLE-SEQUENCEの詩 |
ユーザー | convexineq |
提出日時 | 2021-01-23 17:26:17 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,297 bytes |
コンパイル時間 | 458 ms |
コンパイル使用メモリ | 87,136 KB |
実行使用メモリ | 191,756 KB |
最終ジャッジ日時 | 2023-08-30 02:01:10 |
合計ジャッジ時間 | 38,485 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 75 ms
71,364 KB |
testcase_01 | AC | 74 ms
71,532 KB |
testcase_02 | AC | 82 ms
76,064 KB |
testcase_03 | AC | 81 ms
76,088 KB |
testcase_04 | AC | 74 ms
71,140 KB |
testcase_05 | AC | 74 ms
71,452 KB |
testcase_06 | AC | 75 ms
71,392 KB |
testcase_07 | AC | 74 ms
71,448 KB |
testcase_08 | WA | - |
testcase_09 | AC | 93 ms
76,268 KB |
testcase_10 | AC | 105 ms
76,696 KB |
testcase_11 | AC | 108 ms
76,920 KB |
testcase_12 | WA | - |
testcase_13 | AC | 105 ms
76,968 KB |
testcase_14 | AC | 97 ms
76,240 KB |
testcase_15 | WA | - |
testcase_16 | AC | 100 ms
76,620 KB |
testcase_17 | AC | 107 ms
77,000 KB |
testcase_18 | AC | 168 ms
78,940 KB |
testcase_19 | AC | 139 ms
77,568 KB |
testcase_20 | AC | 168 ms
78,264 KB |
testcase_21 | AC | 133 ms
78,768 KB |
testcase_22 | WA | - |
testcase_23 | AC | 158 ms
79,776 KB |
testcase_24 | AC | 162 ms
80,444 KB |
testcase_25 | AC | 158 ms
79,860 KB |
testcase_26 | AC | 167 ms
79,484 KB |
testcase_27 | AC | 147 ms
77,916 KB |
testcase_28 | WA | - |
testcase_29 | AC | 443 ms
98,520 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 | 297 ms
98,680 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 | 691 ms
130,792 KB |
testcase_59 | AC | 703 ms
130,640 KB |
testcase_60 | AC | 707 ms
130,796 KB |
testcase_61 | AC | 710 ms
130,772 KB |
testcase_62 | AC | 700 ms
130,712 KB |
testcase_63 | AC | 289 ms
127,648 KB |
testcase_64 | AC | 282 ms
127,792 KB |
testcase_65 | AC | 280 ms
127,768 KB |
testcase_66 | AC | 284 ms
127,716 KB |
testcase_67 | AC | 284 ms
127,844 KB |
testcase_68 | RE | - |
testcase_69 | RE | - |
testcase_70 | AC | 74 ms
71,112 KB |
testcase_71 | AC | 73 ms
71,416 KB |
testcase_72 | AC | 73 ms
71,508 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)