| 记录编号 | 45431 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1210.[NOIP 2010冲刺十二]奶牛晒衣服 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 1.340 s | ||
| 提交时间 | 2012-10-23 22:09:06 | 内存使用 | 2.22 MiB | ||
#include <fstream>
#include <set>
using namespace std;
ifstream fin("dry.in");
ofstream fout("dry.out");
multiset<int>Set;
int N,A,B,C[500001],Ti=0;
int main()
{
fin>>N>>A>>B;
for(int i=1;i<=N;i++)
{
fin>>C[i];
Set.insert(C[i]);
}
Ti=0;
while(Ti*A<*Set.rbegin())
{
int temp=*Set.rbegin()-B;
Ti++;
if(temp<0)
temp=0;
multiset<int>::iterator itemp=Set.end();
itemp--;
Set.erase(itemp);
Set.insert(temp);
}
fout<<Ti;
fin.close();
fout.close();
return 0;
}