记录编号 |
527576 |
评测结果 |
AAAAAAAAAA |
题目名称 |
1707.嘉豪 |
最终得分 |
100 |
用户昵称 |
HZOI_RXR |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
2.021 s |
提交时间 |
2019-02-17 19:45:27 |
内存使用 |
10.79 MiB |
显示代码纯文本
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
int n,tot=0;
double v[1000050],ori;
int main()
{
freopen("jiahao1.in","r",stdin);
freopen("jiahao1.out","w",stdout);
scanf("%lf%d",&ori,&n);
for(int i=0;i<n;i++)scanf("%lf",&v[i]);
sort(v,v+n);
while(tot<n&&ori>v[tot])
{
ori+=v[tot]/2;
tot++;
}
printf("%d",tot);
}