Submission #3246093


Source Code Expand

#include<stdio.h>
int main(){
	int w,h,n,i,c=0,d,e=0,f;
	int x[200],y[200],a[200];
	scanf("%d %d %d",&w,&h,&n);
	d=w;
	f=h;
	for(i=0;i<n;i++){
		scanf("%d %d %d",&x[i],&y[i],&a[i]);
		if(a[i]==1)
			if(c<x[i])
				c=x[i];
		if(a[i]==2)
			if(d>x[i])
				d=x[i];
		if(a[i]==3)
			if(e<y[i])
				e=y[i];
		if(a[i]==4)
			if(f>y[i])
				f=y[i];
	}
	if(c>=d || e>=f)
		printf("0\n");
	else
		printf("%d\n",(d-c)*(f-e));
	return 0;
}

Submission Info

Submission Time
Task B - Snuke's Coloring 2 (ABC Edit)
User vjudge1
Language C (GCC 5.4.1)
Score 200
Code Size 428 Byte
Status AC
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:5:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d %d",&w,&h,&n);
  ^
./Main.c:9:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d %d",&x[i],&y[i],&a[i]);
   ^

Judge Result

Set Name sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 13
Set Name Test Cases
sample sample_01.txt, sample_02.txt, sample_03.txt
All dir_01.txt, dir_02.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, sample_01.txt, sample_02.txt, sample_03.txt, small_01.txt, small_02.txt, small_03.txt, small_04.txt
Case Name Status Exec Time Memory
dir_01.txt AC 1 ms 128 KB
dir_02.txt AC 1 ms 128 KB
random_01.txt AC 1 ms 128 KB
random_02.txt AC 1 ms 128 KB
random_03.txt AC 1 ms 128 KB
random_04.txt AC 1 ms 128 KB
sample_01.txt AC 0 ms 128 KB
sample_02.txt AC 0 ms 128 KB
sample_03.txt AC 1 ms 128 KB
small_01.txt AC 0 ms 128 KB
small_02.txt AC 0 ms 128 KB
small_03.txt AC 1 ms 128 KB
small_04.txt AC 1 ms 128 KB