Accepted
代码
#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int N = 1e5 + 101;
int n, m, t[N];
LL c, nowtim;
signed main()
{
scanf("%d%d",&n,&m);
for(int i = 1;i <= n; i++) scanf("%d",&t[i]);
sort(t + 1,t + n + 1);
for(int i = 1;i <= n; i++)
nowtim += (LL)(n - i + 1) * (LL)t[i];
if(nowtim >= m) puts("Yes");
else puts("No");
}
信息
- 递交者
- 类型
- 递交
- 题目
- P1007 hitwh 2019 新生赛 H Songer and his army
- 语言
- C++
- 递交时间
- 2020-12-17 19:49:57
- 评测时间
- 2020-12-17 19:49:57
- 评测机
- 分数
- 100
- 总耗时
- 15ms
- 峰值内存
- 232.0 KiB