记录详情

Accepted

/in/foo.cc: In function 'int main()':
/in/foo.cc:12:19: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
     if(F[i] = F[j]) break;
                   ^
# 状态 耗时 内存占用
#1 Accepted 1ms 216.0 KiB
#2 Accepted 1ms 220.0 KiB
#3 Accepted 1ms 228.0 KiB
#4 Accepted 1ms 348.0 KiB
#5 Accepted 1ms 228.0 KiB
#6 Accepted 1ms 216.0 KiB
#7 Accepted 1ms 232.0 KiB
#8 Accepted 1ms 220.0 KiB
#9 Accepted 1ms 228.0 KiB
#10 Accepted 1ms 220.0 KiB
#11 Accepted 1ms 228.0 KiB
#12 Accepted 1ms 344.0 KiB
#13 Accepted 1ms 228.0 KiB

代码

#include<bits/stdc++.h>
using namespace std;
const int A = 1e5+17,AA = 1e4+17;
int n,m,kk,F[A],tr[A];
int main(){
	scanf("%d%d%d",&n,&m,&kk);
	for(int i=1;i<=m;++i)
		F[i]=1;
	if(m>=kk)
		for(int i=m+1;i<=AA;++i)
			for(int j=i-m-1;j<=i-kk-1;++j)
				if(F[i] = F[j])	break;
	for(int i=1,a;i<=n;++i){
		scanf("%d",&a);
		if(!F[a]){
			printf("No");
			return 0;
		}
	}
	printf("Yes");
	return 0;
}

信息

递交者
类型
递交
题目
P1002 hitwh 2019 新生赛 C cqsss and his enterprise
语言
C++
递交时间
2020-12-19 16:02:26
评测时间
2020-12-19 16:02:26
评测机
分数
100
总耗时
21ms
峰值内存
348.0 KiB