记录详情

Accepted


  
# 状态 耗时 内存占用
#1 Accepted 1ms 204.0 KiB
#2 Accepted 1ms 232.0 KiB
#3 Accepted 1ms 216.0 KiB
#4 Accepted 1ms 228.0 KiB
#5 Accepted 1ms 220.0 KiB
#6 Accepted 1ms 228.0 KiB
#7 Accepted 1ms 220.0 KiB
#8 Accepted 1ms 228.0 KiB
#9 Accepted 1ms 220.0 KiB

代码

#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