結果

問題 No.9 モンスターのレベル上げ
ユーザー こるこる
提出日時 2017-01-06 17:43:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 844 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,884 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-08-22 15:18:26
合計ジャッジ時間 7,180 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,560 KB
testcase_01 AC 18 ms
8,636 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 copy
from operator import itemgetter
n=int(input())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
a.sort()
def fun(index):
    array_p=copy.deepcopy(a)
    array=[[i,0] for i in array_p]
    if index==n:
        return math.inf

    for i in range(index,len(b)+index):
        array.sort(key=itemgetter(0))
        j=0
        mini=array[j][1]
        a_index=j
        while array[j][0]==array[j+1][0] and j<n-1:
            if array[j][1]>array[j+1][1]:
                mini=array[j+1][1]
                a_index=j+1
            j+=1
        j=a_index
        #print("array=",array)
        #print("a_index=",a_index)
        array[j][0]+=int(b[i%n]/2)
        array[j][1]+=1

    ret=max(array,key=itemgetter(1))[1]
    #print(index)
    #print(ret)
    return min(ret,fun(index+1))
print(fun(0))
0