結果

問題 No.9 モンスターのレベル上げ
ユーザー こるこる
提出日時 2017-01-06 18:38:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 686 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 98,836 KB
最終ジャッジ日時 2023-08-22 15:19:25
合計ジャッジ時間 6,741 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
9,056 KB
testcase_01 AC 23 ms
9,060 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
import queue

class zako:
    def __init__(self,level,times):
        self.level=level
        self.times=times

    def __lt__(self,z):
        return self.times+self.level*100000<z.times+z.level*100000

n=int(input())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]

def fun(index):
    q=queue.PriorityQueue()
    for i in a:
        q.put(zako(i,0))

    if index==n:
        return math.inf

    maxi=0

    for i in range(index,n+index):
        z=q.get()
        z.level+=int(b[i%n]/2)
        z.times+=1
        if z.times>maxi: maxi=z.times
        q.put(z)


    #print(index)
    #print(ret)
    return min(maxi,fun(index+1))
print(fun(0))
0