| 记录编号 | 548758 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1210.[NOIP 2010冲刺十二]奶牛晒衣服 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.648 s | ||
| 提交时间 | 2020-01-31 13:48:26 | 内存使用 | 13.66 MiB | ||
#include <iostream>
#include <queue>
#include <cstdio>
using namespace std;
priority_queue <int> cloth;
int main()
{
freopen("dry.in","r",stdin);
freopen("dry.out","w",stdout);
int n,a,b;
cin >> n >> a >> b;
int iIn;
for(int i = 0;i < n;i++)
{
cin >> iIn;
cloth.push(iIn);
}
int t = 0,temp;
while(cloth.top() > t * a)
{
temp = cloth.top();
cloth.pop();
temp -= b;
if(temp - t * a > 0)
cloth.push(temp);
t++;
}
cout << t;
return 0;
}