记录详情

Wrong Answer


  
# 状态 耗时 内存占用
#1 Accepted 1ms 216.0 KiB
#2 Accepted 1ms 220.0 KiB
#3 Accepted 1ms 232.0 KiB
#4 Accepted 1ms 216.0 KiB
#5 Accepted 1ms 224.0 KiB
#6 Accepted 1ms 220.0 KiB
#7 Accepted 1ms 232.0 KiB
#8 Wrong Answer 1ms 220.0 KiB
#9 Accepted 1ms 216.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<<"Yes";
			return 0;
		}
	}
	cout<<"No";
	return 0;
}

信息

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