結果
問題 | No.1361 [Zelkova 4th Tune *] QUADRUPLE-SEQUENCEの詩 |
ユーザー | Kude |
提出日時 | 2021-01-22 23:26:47 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,427 bytes |
コンパイル時間 | 219 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 150,344 KB |
最終ジャッジ日時 | 2024-06-08 18:24:01 |
合計ジャッジ時間 | 24,840 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 40 ms
52,096 KB |
testcase_01 | AC | 39 ms
52,864 KB |
testcase_02 | AC | 42 ms
59,008 KB |
testcase_03 | AC | 47 ms
60,928 KB |
testcase_04 | WA | - |
testcase_05 | AC | 40 ms
52,352 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 | 572 ms
148,092 KB |
testcase_49 | AC | 432 ms
148,096 KB |
testcase_50 | AC | 596 ms
148,256 KB |
testcase_51 | AC | 506 ms
148,220 KB |
testcase_52 | AC | 537 ms
148,480 KB |
testcase_53 | WA | - |
testcase_54 | WA | - |
testcase_55 | WA | - |
testcase_56 | WA | - |
testcase_57 | WA | - |
testcase_58 | AC | 312 ms
121,124 KB |
testcase_59 | AC | 314 ms
121,204 KB |
testcase_60 | AC | 623 ms
120,920 KB |
testcase_61 | AC | 620 ms
121,040 KB |
testcase_62 | AC | 612 ms
121,044 KB |
testcase_63 | RE | - |
testcase_64 | RE | - |
testcase_65 | RE | - |
testcase_66 | RE | - |
testcase_67 | RE | - |
testcase_68 | RE | - |
testcase_69 | RE | - |
testcase_70 | RE | - |
testcase_71 | RE | - |
testcase_72 | AC | 36 ms
52,352 KB |
testcase_73 | RE | - |
ソースコード
from itertools import product from bisect import bisect_left 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)) i = bisect_left(a, 0) 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 >> 1 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 print(*ans)