結果

問題 No.1460 Max of Min
ユーザー shiomusubi496shiomusubi496
提出日時 2021-03-21 16:02:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 869 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 10,932 KB
実行使用メモリ 16,748 KB
最終ジャッジ日時 2023-08-19 16:14:34
合計ジャッジ時間 4,750 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
16,748 KB
testcase_01 AC 13 ms
8,064 KB
testcase_02 AC 14 ms
8,112 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 14 ms
8,168 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 18 ms
8,092 KB
testcase_09 AC 19 ms
8,020 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
testcase_84 -- -
testcase_85 -- -
testcase_86 -- -
testcase_87 -- -
testcase_88 -- -
testcase_89 -- -
testcase_90 -- -
testcase_91 -- -
testcase_92 -- -
testcase_93 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

INF=10**18;
def op(a,b):
    c=[[-INF]*len(b[0])for i in range(len(a))]
    for i in range(len(a)):
        for j in range(len(b[0])):
            c[i][j]=max([min(a[i][k],b[k][j])for k in range(len(b))])
    return c
def e(K):
    a=[[-INF]*K for i in range(K)]
    for i in range(K):
        a[i][i]=INF;
    return a
def my_pow(a,b):
    if b==0:
        return e(len(a))
    if b%2==1:
        return op(my_pow(a,b-1),a)
    c=my_pow(a,b//2);
    return op(c,c)
K,N=map(int,input().split())
assert 1<=K<=100
assert 0<=N<=INF
A=list(map(int,input().split()))
B=list(map(int,input().split()))
for i in A:
    assert -INF<=i<=INF
for i in B:
    assert -INF<=i<=INF
a=[[-INF]for i in range(K)]
b=[[-INF]*K for i in range(K)]
for i in range(K):
    a[i][0]=A[i]
for i in range(K):
    b[K-1][i]=B[i]
for i in range(K-1):
    b[i][i+1]=INF
print(op(my_pow(b,N),a)[0][0])
0