結果

問題 No.1739 Princess vs. Dragoness (& AoE)
ユーザー ytftytft
提出日時 2021-12-27 22:18:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 720 bytes
コンパイル時間 1,684 ms
コンパイル使用メモリ 172,144 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-08 16:38:20
合計ジャッジ時間 6,789 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 WA -
testcase_04 AC 66 ms
6,676 KB
testcase_05 AC 69 ms
6,676 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 32 ms
6,676 KB
testcase_09 AC 48 ms
6,676 KB
testcase_10 AC 30 ms
6,676 KB
testcase_11 AC 19 ms
6,676 KB
testcase_12 AC 6 ms
6,676 KB
testcase_13 WA -
testcase_14 AC 49 ms
6,676 KB
testcase_15 AC 61 ms
6,676 KB
testcase_16 AC 26 ms
6,676 KB
testcase_17 AC 30 ms
6,676 KB
testcase_18 AC 37 ms
6,676 KB
testcase_19 AC 29 ms
6,676 KB
testcase_20 WA -
testcase_21 AC 48 ms
6,676 KB
testcase_22 AC 55 ms
6,676 KB
testcase_23 AC 62 ms
6,676 KB
testcase_24 AC 68 ms
6,676 KB
testcase_25 AC 69 ms
6,676 KB
testcase_26 WA -
testcase_27 AC 68 ms
6,676 KB
testcase_28 WA -
testcase_29 AC 68 ms
6,676 KB
testcase_30 AC 68 ms
6,676 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 2 ms
6,676 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 3 ms
6,676 KB
testcase_39 AC 2 ms
6,676 KB
testcase_40 AC 2 ms
6,676 KB
testcase_41 AC 2 ms
6,676 KB
testcase_42 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N,A,X,Y,index=0,input;
    long long ans,B;
    cin>>N>>A>>B>>X>>Y;
    long long diff[N];
    B*=Y;
    priority_queue<int> q;
    for(int i=0;i<N;++i){
        cin>>input;
        q.push(input);
    }
    for(int i=0;i<A;++i){
        q.push(max(0,q.top()-X));
        q.pop();
    }
    for(int i=N-1;i>=0;--i){
        diff[i]=q.top();
        q.pop();
    }
    ans=diff[N-1];
    for(int i=N-1;i>=1;--i){
        diff[i]-=diff[i-1];
    }
    for(int i=N-1;i>=0;--i){
        if(diff[i]*(N-i)>=B){
            cout<<(ans-B/(N-i))<<endl;
            return 0;
        }else{
            ans-=diff[i];
            B-=diff[i]*(N-i);
        }
    }
}
0