結果
問題 | No.1361 [Zelkova 4th Tune *] QUADRUPLE-SEQUENCEの詩 |
ユーザー | Kude |
提出日時 | 2021-01-22 23:41:50 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,376 bytes |
コンパイル時間 | 209 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 150,364 KB |
最終ジャッジ日時 | 2024-06-08 18:55:25 |
合計ジャッジ時間 | 22,845 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 35 ms
52,096 KB |
testcase_01 | AC | 35 ms
52,480 KB |
testcase_02 | AC | 40 ms
58,624 KB |
testcase_03 | AC | 45 ms
60,160 KB |
testcase_04 | WA | - |
testcase_05 | AC | 34 ms
53,120 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 | 539 ms
148,520 KB |
testcase_49 | AC | 407 ms
148,512 KB |
testcase_50 | AC | 550 ms
148,664 KB |
testcase_51 | AC | 479 ms
148,444 KB |
testcase_52 | AC | 507 ms
148,296 KB |
testcase_53 | WA | - |
testcase_54 | WA | - |
testcase_55 | WA | - |
testcase_56 | WA | - |
testcase_57 | WA | - |
testcase_58 | AC | 291 ms
120,860 KB |
testcase_59 | AC | 298 ms
121,132 KB |
testcase_60 | AC | 559 ms
120,808 KB |
testcase_61 | AC | 566 ms
121,064 KB |
testcase_62 | AC | 560 ms
121,064 KB |
testcase_63 | AC | 111 ms
100,876 KB |
testcase_64 | AC | 111 ms
100,864 KB |
testcase_65 | AC | 109 ms
100,868 KB |
testcase_66 | AC | 112 ms
100,256 KB |
testcase_67 | AC | 115 ms
100,480 KB |
testcase_68 | AC | 38 ms
52,736 KB |
testcase_69 | AC | 35 ms
52,480 KB |
testcase_70 | AC | 37 ms
52,480 KB |
testcase_71 | AC | 38 ms
52,864 KB |
testcase_72 | AC | 34 ms
52,608 KB |
testcase_73 | AC | 34 ms
52,992 KB |
ソースコード
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)