結果

問題 No.9 モンスターのレベル上げ
ユーザー mkawa2mkawa2
提出日時 2020-01-02 09:22:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,300 ms / 5,000 ms
コード長 1,154 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 11,072 KB
実行使用メモリ 30,572 KB
最終ジャッジ日時 2023-08-14 18:15:12
合計ジャッジ時間 21,215 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
29,856 KB
testcase_01 AC 107 ms
30,160 KB
testcase_02 AC 2,036 ms
30,428 KB
testcase_03 AC 1,516 ms
30,424 KB
testcase_04 AC 845 ms
30,308 KB
testcase_05 AC 593 ms
30,084 KB
testcase_06 AC 277 ms
30,192 KB
testcase_07 AC 115 ms
30,132 KB
testcase_08 AC 331 ms
30,248 KB
testcase_09 AC 1,943 ms
30,452 KB
testcase_10 AC 110 ms
30,052 KB
testcase_11 AC 1,766 ms
30,572 KB
testcase_12 AC 2,300 ms
30,240 KB
testcase_13 AC 1,775 ms
30,488 KB
testcase_14 AC 1,983 ms
30,440 KB
testcase_15 AC 1,796 ms
30,424 KB
testcase_16 AC 139 ms
30,112 KB
testcase_17 AC 1,124 ms
30,352 KB
testcase_18 AC 969 ms
30,328 KB
testcase_19 AC 125 ms
30,124 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