Submission #1128704


Source Code Expand

#include<stdio.h>

int main(void){
	long long int red=0,blue=0,high=0,lengh=0,deeper=0;
	scanf("%lld %lld  %lld",&high,&lengh,&deeper);
	
	if(high<=lengh){
		if(lengh<=deeper){
			red=high*lengh*(deeper/2+deeper%2);
			blue=high*lengh*(deeper/2);
		}
		else{
			red=high*(lengh/2+lengh%2)*deeper;
			blue=high*(lengh/2)*deeper;
		}
	}
	else if(high<=deeper){
		if(deeper<=lengh){
			red=high*(lengh/2+lengh%2)*deeper;
			blue=high*(lengh/2)*deeper;
		}
		else{
			red=high*lengh*(deeper/2+deeper%2);
			blue=high*lengh*(deeper/2);
		}
	}
	else{
		if(deeper<=high){
			red=(high/2+high%2)*lengh*deeper;
			blue=(high/2)*lengh*deeper;
		}
		else{
			red=high*lengh*(deeper/2+deeper%2);
			blue=high*lengh*(deeper/2);
		}
	}
	
	printf("%lld\n",red-blue);
	
	return 0;
}

Submission Info

Submission Time
Task A - Divide a Cuboid
User hanami03
Language C (GCC 5.4.1)
Score 200
Code Size 806 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("%lld %lld  %lld",&high,&lengh,&deeper);
  ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 9
Set Name Test Cases
Sample 0_00.txt, 0_01.txt, 0_02.txt
All 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt
Case Name Status Exec Time Memory
0_00.txt AC 1 ms 128 KB
0_01.txt AC 1 ms 128 KB
0_02.txt AC 1 ms 128 KB
1_00.txt AC 1 ms 128 KB
1_01.txt AC 1 ms 128 KB
1_02.txt AC 1 ms 128 KB
1_03.txt AC 1 ms 128 KB
1_04.txt AC 1 ms 128 KB
1_05.txt AC 1 ms 128 KB