比赛 |
20121023 |
评测结果 |
AAAAAAAAAA |
题目名称 |
奶牛晒衣服 |
最终得分 |
100 |
用户昵称 |
feng |
运行时间 |
0.269 s |
代码语言 |
C++ |
内存使用 |
2.60 MiB |
提交时间 |
2012-10-23 19:41:55 |
显示代码纯文本
- #include<cstdio>
- #include<cstring>
- #include<algorithm>
- #include<iostream>
- using namespace std;
- int n,a,b,x,maxn,o,i;
- int f[600000];
-
- int main()
- {
- freopen("dry.in","r",stdin);
- freopen("dry.out","w",stdout);
- scanf("%d%d%d",&n,&a,&b);
- memset(f,0,sizeof(f));
- maxn=0;
- for (i=1;i<=n;i++){
- scanf("%d",&x);
- if (x>maxn) maxn=x;
- f[x]++;
- }
- o=0;
- for (i=maxn;i>=1;i--){
- while (f[i]>0){
- if (i<=o){
- printf("%d",o/a);
- return 0;
- }
- f[i]--;
- if ((i-b)>o)
- f[i-b]++;
- o+=a;
-
- }
- }
- return 0;
- }