记录详情

Runtime Error

/in/foo.c: In function 'main':
/in/foo.c:29:2: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  if(t=0)
  ^~
/in/foo.c:40:2: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  if(t=0){printf("Yes\n");return 1;
  ^~
/in/foo.c:42:2: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  if(t=1){ printf("No\n");return 1;
  ^~
# 状态 耗时 内存占用
#1 Runtime Error 1ms 220.0 KiB
#2 Runtime Error 1ms 220.0 KiB
#3 Runtime Error 0ms 128.0 KiB
#4 Runtime Error 0ms 220.0 KiB
#5 Runtime Error 1ms 128.0 KiB
#6 Runtime Error 0ms 216.0 KiB
#7 Runtime Error 0ms 128.0 KiB
#8 Runtime Error 0ms 220.0 KiB
#9 Runtime Error 0ms 228.0 KiB
#10 Runtime Error 0ms 220.0 KiB
#11 Runtime Error 0ms 128.0 KiB
#12 Runtime Error 0ms 216.0 KiB
#13 Runtime Error 0ms 216.0 KiB

代码

#include<stdio.h>
int main()
{
	int n,m,k,i,a[1000],t;
	scanf("%d%d%d",&n,&m,&k);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	if(m>k)
	{printf("Yes\n");return 1;
	}
	if(m<k)
	{
		for(i=0;i<n;i++)
		{
			if(a[i]>m)
			{printf("No\n");return 1;
			}
		}
		printf("Yes\n");return 1;
	}
	t=0;
	for(i=0;i<n;i++)
	{
		if(a[i]>m)
		t=1;
	}
	if(t=0)
	{
		printf("Yes\n");return 1;
	}
	
	t=0; 
	for(i=0;i<n;i++)
	{
	if(a[i]%(m+1)==0)
	t=1;
	}
	if(t=0){printf("Yes\n");return 1;
	}	
	if(t=1){	printf("No\n");return 1;
	}
	return 0;
}

信息

递交者
类型
递交
题目
P1002 hitwh 2019 新生赛 C cqsss and his enterprise
语言
C
递交时间
2020-12-19 15:55:54
评测时间
2020-12-19 15:55:54
评测机
分数
0
总耗时
11ms
峰值内存
228.0 KiB