結果
問題 | No.1361 [Zelkova 4th Tune *] QUADRUPLE-SEQUENCEの詩 |
ユーザー | convexineq |
提出日時 | 2021-01-23 17:44:35 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,312 bytes |
コンパイル時間 | 129 ms |
コンパイル使用メモリ | 82,148 KB |
実行使用メモリ | 188,232 KB |
最終ジャッジ日時 | 2024-06-10 01:23:56 |
合計ジャッジ時間 | 27,808 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 36 ms
53,140 KB |
testcase_01 | AC | 37 ms
53,236 KB |
testcase_02 | AC | 42 ms
61,384 KB |
testcase_03 | AC | 45 ms
61,796 KB |
testcase_04 | AC | 39 ms
53,512 KB |
testcase_05 | AC | 36 ms
53,376 KB |
testcase_06 | AC | 35 ms
53,684 KB |
testcase_07 | AC | 34 ms
53,440 KB |
testcase_08 | AC | 55 ms
68,116 KB |
testcase_09 | AC | 54 ms
67,172 KB |
testcase_10 | AC | 65 ms
72,040 KB |
testcase_11 | AC | 64 ms
72,300 KB |
testcase_12 | AC | 56 ms
68,108 KB |
testcase_13 | AC | 70 ms
73,036 KB |
testcase_14 | AC | 56 ms
67,508 KB |
testcase_15 | AC | 69 ms
73,888 KB |
testcase_16 | AC | 57 ms
69,456 KB |
testcase_17 | AC | 63 ms
72,100 KB |
testcase_18 | AC | 122 ms
77,752 KB |
testcase_19 | AC | 93 ms
76,480 KB |
testcase_20 | AC | 122 ms
76,888 KB |
testcase_21 | AC | 91 ms
77,220 KB |
testcase_22 | AC | 99 ms
77,212 KB |
testcase_23 | AC | 114 ms
78,184 KB |
testcase_24 | AC | 112 ms
79,240 KB |
testcase_25 | AC | 112 ms
78,788 KB |
testcase_26 | AC | 118 ms
78,376 KB |
testcase_27 | AC | 99 ms
76,468 KB |
testcase_28 | AC | 419 ms
106,268 KB |
testcase_29 | AC | 369 ms
97,584 KB |
testcase_30 | AC | 345 ms
92,124 KB |
testcase_31 | AC | 433 ms
100,284 KB |
testcase_32 | AC | 442 ms
129,048 KB |
testcase_33 | AC | 326 ms
90,888 KB |
testcase_34 | AC | 476 ms
115,724 KB |
testcase_35 | AC | 521 ms
103,296 KB |
testcase_36 | AC | 726 ms
130,000 KB |
testcase_37 | AC | 233 ms
96,616 KB |
testcase_38 | AC | 423 ms
97,844 KB |
testcase_39 | AC | 285 ms
88,884 KB |
testcase_40 | AC | 345 ms
95,204 KB |
testcase_41 | AC | 449 ms
110,484 KB |
testcase_42 | AC | 708 ms
117,336 KB |
testcase_43 | AC | 441 ms
103,084 KB |
testcase_44 | AC | 540 ms
105,304 KB |
testcase_45 | AC | 463 ms
100,876 KB |
testcase_46 | AC | 493 ms
119,540 KB |
testcase_47 | AC | 300 ms
96,624 KB |
testcase_48 | AC | 693 ms
187,500 KB |
testcase_49 | AC | 575 ms
187,824 KB |
testcase_50 | AC | 695 ms
188,192 KB |
testcase_51 | AC | 625 ms
188,232 KB |
testcase_52 | AC | 660 ms
187,428 KB |
testcase_53 | AC | 931 ms
140,976 KB |
testcase_54 | AC | 916 ms
140,980 KB |
testcase_55 | AC | 945 ms
141,044 KB |
testcase_56 | AC | 922 ms
140,732 KB |
testcase_57 | AC | 690 ms
141,180 KB |
testcase_58 | AC | 595 ms
129,496 KB |
testcase_59 | AC | 616 ms
129,848 KB |
testcase_60 | AC | 595 ms
129,520 KB |
testcase_61 | AC | 602 ms
129,496 KB |
testcase_62 | AC | 592 ms
129,584 KB |
testcase_63 | AC | 222 ms
120,044 KB |
testcase_64 | AC | 223 ms
120,648 KB |
testcase_65 | AC | 218 ms
120,176 KB |
testcase_66 | AC | 226 ms
119,564 KB |
testcase_67 | AC | 219 ms
120,676 KB |
testcase_68 | AC | 34 ms
54,988 KB |
testcase_69 | AC | 34 ms
54,456 KB |
testcase_70 | AC | 34 ms
53,760 KB |
testcase_71 | AC | 33 ms
53,344 KB |
testcase_72 | AC | 34 ms
54,584 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) 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)