結果

問題 No.9 モンスターのレベル上げ
ユーザー A63635985A63635985
提出日時 2018-03-01 02:28:04
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,474 bytes
コンパイル時間 784 ms
コンパイル使用メモリ 72,404 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-24 21:07:54
合計ジャッジ時間 2,481 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 89 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 28 ms
4,376 KB
testcase_06 AC 8 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 10 ms
4,380 KB
testcase_09 AC 81 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 66 ms
4,380 KB
testcase_12 AC 164 ms
4,376 KB
testcase_13 AC 3 ms
4,380 KB
testcase_14 AC 80 ms
4,376 KB
testcase_15 WA -
testcase_16 AC 3 ms
4,380 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include <queue>
using namespace std;
struct Struct{
        int count,level;
        bool operator<(const Struct &other)const{
                if(level==other.level)
                        return count>other.count;
                else
                        return level>other.level;
        }
};
int main(){
        int N;
        cin >>N;
        vector <int>b;
        vector <Struct> a;
        priority_queue <Struct> aaa;
        for(int i=0 ; i<N ; i++ ){
                Struct x;cin >> x.level;
                x.count=0;
                a.push_back(x);
                aaa.push(x);
        }for(int i=0 ; i<N ; i++ ){
                int x;cin >> x;
                b.push_back(int((x/2)-0.4));
        }
        int Max=2000000000;
        for(int i=0 ; i<N ; i++ ){
                priority_queue<Struct> now=aaa;
                int counter=0,tmax=0;
                while(counter!=N){
                        int l=(i+counter)%N;
                        Struct next;
                        next.level=now.top().level+b[l];
                        next.count=now.top().count+1;
                        now.pop();
                        now.push(next);
                        counter++;
                        if(tmax<next.count)tmax=next.count;
                        if(Max<=tmax)break;
                }
                if(Max>tmax)Max=tmax;
        }
        cout <<Max<<endl;
        return 0;
}
0