結果

問題 No.9 モンスターのレベル上げ
ユーザー mkawa2mkawa2
提出日時 2020-01-02 09:22:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,304 ms / 5,000 ms
コード長 1,154 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,912 KB
最終ジャッジ日時 2024-05-02 06:15:14
合計ジャッジ時間 34,014 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 489 ms
44,664 KB
testcase_01 AC 497 ms
44,664 KB
testcase_02 AC 2,977 ms
44,660 KB
testcase_03 AC 2,332 ms
44,664 KB
testcase_04 AC 1,435 ms
44,792 KB
testcase_05 AC 1,126 ms
44,788 KB
testcase_06 AC 699 ms
44,652 KB
testcase_07 AC 467 ms
44,784 KB
testcase_08 AC 767 ms
44,784 KB
testcase_09 AC 2,962 ms
44,656 KB
testcase_10 AC 488 ms
44,660 KB
testcase_11 AC 2,699 ms
44,664 KB
testcase_12 AC 3,304 ms
44,660 KB
testcase_13 AC 2,699 ms
44,664 KB
testcase_14 AC 2,847 ms
44,664 KB
testcase_15 AC 2,610 ms
44,912 KB
testcase_16 AC 487 ms
44,532 KB
testcase_17 AC 1,777 ms
44,784 KB
testcase_18 AC 1,567 ms
44,532 KB
testcase_19 AC 469 ms
44,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import *
from bisect import *
from math import *
from collections import *
from heapq import *
from random import *
from decimal import *
import numpy as np
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def MF(): return map(float, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LF(): return list(map(float, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    n=II()
    aa=LI()
    bb=LI()
    bb*=2
    friends=[[a,0] for a in aa]
    heapify(friends)
    ans=10**9
    for i in range(n):
        ff=friends.copy()
        mx=0
        for b in bb[i:i+n]:
            a,cnt=heappop(ff)
            heappush(ff,[a+b//2,cnt+1])
            if cnt+1>mx:mx=cnt+1
        ans=min(ans,mx)
    print(ans)

main()
0