记录编号 | 45422 | 评测结果 | AAAAAAAAAA | ||
---|---|---|---|---|---|
题目名称 | 1210.[NOIP 2010冲刺十二]奶牛晒衣服 | 最终得分 | 100 | ||
用户昵称 | 是否通过 | 通过 | |||
代码语言 | C++ | 运行时间 | 1.335 s | ||
提交时间 | 2012-10-23 22:03:38 | 内存使用 | 0.27 MiB | ||
#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; }