結果

問題 No.1460 Max of Min
ユーザー shotoyoo
提出日時 2021-03-31 22:09:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 359 ms
コンパイル使用メモリ 82,188 KB
実行使用メモリ 83,928 KB
最終ジャッジ日時 2024-12-15 19:13:59
合計ジャッジ時間 50,635 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 82 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

sys.setrecursionlimit(2*10**5+10)
write = lambda x: sys.stdout.write(x+"\n")
debug = lambda x: sys.stderr.write(x+"\n")

k,n = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
def sub(a,b):
    return max([min(a[i], b[i]) for i in range(k)])
l = a[:]
for i in range(100*k+1):
    l.append(sub(l[-k:], b))
if n<len(l):
    print(l[n])
else:
    tmp = l[-k:]
    print(tmp[(n-len(l))%k])
0