P1843 奶牛晒衣服
直接贪心…
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<queue>
#include<cstring>
#include<cmath>
#include<vector>
#define ls (p<<1)
#define rs (p<<1|1)
//#define mid (l+r)/2
#define over(i,s,t) for(register long long i=s;i<=t;++i)
#define lver(i,t,s) for(register long long i=t;i>=s;--i)
//#define int __int128
using namespace std;
typedef long long ll;//全用ll可能会MLE或者直接WA,试着改成int看会不会A
const ll N=1e5+7;
const ll INF=1e10+9;
const ll mod=2147483647;
const double EPS=1e-10;//-10次方约等于趋近为0
const double Pi=3.1415926535897;
priority_queue<ll>q;
ll n,m,a;
ll A,B;
int main()
{
scanf("%lld%lld%lld",&n,&A,&B);
over(i,1,n)
scanf("%lld",&a),q.push(a);
ll now=0;
while(1)
{
ll k=q.top();
q.pop();
if(k-now<=0)//如果湿度最大的都可以直接被累加的正常挥发量烘干,那么至此所有的衣服都将被烘干
{
printf("%lld\n",now/A);
return 0;
}
now+=A;
k-=B;
q.push(k);
}
return 0;
}