Submission #147348


Source Code Expand

#include<stdio.h>
int main(void)
{
	int t,n,m,i,j;
	int time[100];
	int a[100]={0};
	int b[100]={0};
	int people[100];
	int min=100;
	
	scanf("%d",&t);
	scanf("%d",&n);	
	for(i=0;i<n;i++){
		scanf("%d",&time[i]);
	}
	
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&people[i]);
	}
	
	if(n<m){
		printf("no\n");
		return 0;
	}
	else if(n==m){
		for(i=0;i<n;i++){
			if(people[i]-time[i]<0 || people[i]-time[i]>t){
				printf("no\n");
				return 0;
			}
		}
		printf("yes\n",min);
		return 0;
	}
	else{
		for(i=0;i<m;i++){
			for(j=0;j<n;j++){
				if(people[i]-time[j]>=t){
					if(a[j]==0){
						a[j]=1;
						b[i]=1;
					}
				}
			}
		}
	}
	for(i=0;i<m;i++){
		if(b[i]==0){
			printf("no\n");
			return 0;
		}
	}
	printf("yes\n");
	return 0;
}
		

Submission Info

Submission Time
Task C - おいしいたこ焼きの売り方
User ovoriruovo
Language C (GCC 4.6.4)
Score 0
Code Size 809 Byte
Status WA
Exec Time 29 ms
Memory 972 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:11:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
./Main.c:12:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
./Main.c:14:8: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
./Main.c:17:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
./Main.c:19:8: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 29
WA × 6
Set Name Test Cases
All rand0.txt, rand1.txt, rand10.txt, rand11.txt, rand12.txt, rand13.txt, rand14.txt, rand15.txt, rand16.txt, rand17.txt, rand18.txt, rand19.txt, rand2.txt, rand20.txt, rand21.txt, rand22.txt, rand23.txt, rand24.txt, rand25.txt, rand26.txt, rand27.txt, rand28.txt, rand29.txt, rand3.txt, rand4.txt, rand5.txt, rand6.txt, rand7.txt, rand8.txt, rand9.txt, s1.txt, s2.txt, s3.txt, s4.txt, s5.txt
Case Name Status Exec Time Memory
rand0.txt AC 23 ms 868 KB
rand1.txt AC 26 ms 908 KB
rand10.txt WA 24 ms 872 KB
rand11.txt AC 24 ms 872 KB
rand12.txt AC 21 ms 916 KB
rand13.txt AC 24 ms 872 KB
rand14.txt AC 24 ms 872 KB
rand15.txt AC 24 ms 900 KB
rand16.txt AC 25 ms 932 KB
rand17.txt WA 25 ms 972 KB
rand18.txt AC 24 ms 864 KB
rand19.txt AC 25 ms 908 KB
rand2.txt AC 24 ms 904 KB
rand20.txt AC 24 ms 896 KB
rand21.txt AC 23 ms 880 KB
rand22.txt AC 25 ms 916 KB
rand23.txt AC 24 ms 876 KB
rand24.txt AC 26 ms 900 KB
rand25.txt AC 26 ms 920 KB
rand26.txt AC 25 ms 908 KB
rand27.txt AC 24 ms 916 KB
rand28.txt WA 24 ms 920 KB
rand29.txt WA 29 ms 956 KB
rand3.txt AC 24 ms 900 KB
rand4.txt WA 24 ms 876 KB
rand5.txt AC 24 ms 876 KB
rand6.txt AC 24 ms 872 KB
rand7.txt WA 25 ms 932 KB
rand8.txt AC 24 ms 872 KB
rand9.txt AC 24 ms 900 KB
s1.txt AC 24 ms 876 KB
s2.txt AC 24 ms 868 KB
s3.txt AC 24 ms 900 KB
s4.txt AC 24 ms 904 KB
s5.txt AC 24 ms 876 KB