結果
| 問題 |
No.1739 Princess vs. Dragoness (& AoE)
|
| コンテスト | |
| ユーザー |
ytft
|
| 提出日時 | 2021-12-27 22:18:25 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 720 bytes |
| コンパイル時間 | 1,694 ms |
| コンパイル使用メモリ | 171,324 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-10-01 08:48:19 |
| 合計ジャッジ時間 | 5,333 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 WA * 13 |
ソースコード
#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);
}
}
}
ytft