记录详情

Wrong Answer


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

代码

#include <iostream>

using namespace std;

int a[1001],n,m,ans;
int main(){
	cin>>n>>m;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=a[i];j++){
			ans+=(n-i+1);
		}
		if(ans>m){
			cout<<"No";
			return 0;
		}
	}
	cout<<"Yes";
	return 0;
}

信息

递交者
类型
递交
题目
P1007 hitwh 2019 新生赛 H Songer and his army
语言
C++
递交时间
2020-12-17 20:14:25
评测时间
2020-12-17 20:14:25
评测机
分数
20
总耗时
16ms
峰值内存
232.0 KiB