Wrong Answer
/in/foo.c: In function 'fun': /in/foo.c:4:2: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(flag[step]=1) ^~ /in/foo.c: In function 'main': /in/foo.c:27:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(flag[i]=1) ^~
代码
#include<stdio.h>
int flag[1000];
void fun(int a,int m,int k,int step){
if(flag[step]=1)
return;
if(a<=m){
flag[step]=1;
}else{
int i;
for(i=1;i<=m+k;i++){
fun(a-i,m,k,step);
}
}
}
int main(){
int n,m,k;
int a[1000];
scanf("%d %d %d",&n,&m,&k);
int i;
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
fun(a[i],m,k,i);
int count=0;
for(i=0;i<n;i++)
if(flag[i]=1)
count++;
if(count==n)printf("Yes\n");
else printf("No\n");
return 0;
}
信息
- 递交者
- 类型
- 递交
- 题目
- P1002 hitwh 2019 新生赛 C cqsss and his enterprise
- 语言
- C
- 递交时间
- 2020-12-19 19:03:33
- 评测时间
- 2020-12-19 19:03:33
- 评测机
- 分数
- 35
- 总耗时
- 11ms
- 峰值内存
- 224.0 KiB