結果

問題 No.9 モンスターのレベル上げ
ユーザー こるこる
提出日時 2017-01-06 19:23:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 654 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,844 KB
実行使用メモリ 13,852 KB
最終ジャッジ日時 2023-08-22 15:20:40
合計ジャッジ時間 6,960 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
9,188 KB
testcase_01 AC 23 ms
9,228 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()]
bb=[int(i)//2 for i in input().split()]

mini=math.inf
for i in range(n):
    q = queue.PriorityQueue()
    [q.put(zako(i, 0)) for i in a]
    maxi=0
    for j in range(i,n+i):
        z = q.get()
        z.level+=bb[i%n]
        z.times+=1
        if z.times>mini:
            break
        if z.times>maxi:
            maxi=z.times
        q.put(z)
    mini=min(mini,maxi)
print(mini)
0