比赛 |
20121023 |
评测结果 |
AAAAAAAAAA |
题目名称 |
奶牛晒衣服 |
最终得分 |
100 |
用户昵称 |
Makazeu |
运行时间 |
1.365 s |
代码语言 |
C++ |
内存使用 |
0.27 MiB |
提交时间 |
2012-10-23 19:27:37 |
显示代码纯文本
- #include <cstdio>
- #include <cstdlib>
- #include <set>
- #include <algorithm>
- using namespace std;
- multiset<int> hash;
- int N,A,B,x,ans=0;
- int main()
- {
- freopen("dry.in","r",stdin);
- freopen("dry.out","w",stdout);
- scanf("%d %d %d\n",&N,&A,&B);
- for(int i=1;i<=N;i++)
- {
- scanf("%d\n",&x); hash.insert(x);
- }
- multiset<int> :: iterator iter;
- while(hash.size())
- {
- iter=hash.end(); iter--; x=*iter;
- if(x<=ans*A) break; ans++;
- x-=B; hash.erase(iter);
- if(x>0) hash.insert(x);
- }
- printf("%d\n",ans);
- return 0;
- }