結果
問題 | No.1361 [Zelkova 4th Tune *] QUADRUPLE-SEQUENCEの詩 |
ユーザー | Kude |
提出日時 | 2021-01-22 23:34:43 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,376 bytes |
コンパイル時間 | 547 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 150,240 KB |
最終ジャッジ日時 | 2024-06-08 18:42:47 |
合計ジャッジ時間 | 26,768 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 39 ms
52,096 KB |
testcase_01 | AC | 36 ms
52,096 KB |
testcase_02 | AC | 45 ms
58,624 KB |
testcase_03 | AC | 47 ms
60,288 KB |
testcase_04 | WA | - |
testcase_05 | AC | 38 ms
52,224 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 | 611 ms
148,312 KB |
testcase_49 | AC | 467 ms
148,312 KB |
testcase_50 | AC | 632 ms
148,444 KB |
testcase_51 | AC | 545 ms
148,440 KB |
testcase_52 | AC | 546 ms
148,444 KB |
testcase_53 | WA | - |
testcase_54 | WA | - |
testcase_55 | WA | - |
testcase_56 | WA | - |
testcase_57 | WA | - |
testcase_58 | AC | 315 ms
120,936 KB |
testcase_59 | AC | 316 ms
121,060 KB |
testcase_60 | AC | 608 ms
121,064 KB |
testcase_61 | AC | 601 ms
120,932 KB |
testcase_62 | AC | 610 ms
121,064 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 | 37 ms
52,224 KB |
testcase_73 | RE | - |
ソースコード
from itertools import product 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)) 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) // 2 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)