Submission #736570


Source Code Expand

#include <stdio.h>

int main(void)
{
	int L,X,Y,S,D,Lcw,Lccw;
	double Tcw,Tccw;
	scanf("%d %d %d %d %d",&L,&X,&Y,&S,&D);
	Lcw = (D-S+L)%L;
	Lccw = L-Lcw;
	if(X>Y) Tccw = Lcw/(double)(X-Y);
	else Tccw = Lccw/(double)(Y-X);
	Tcw = Lcw/(double)(X+Y);
	//ans=min(Tcw,Tccw);
	//printf("Tcw:%lf\n",Tcw);
	//printf("Lccw:%d\n",Lccw);
	//printf("Tccw:%lf\n",Tccw);
	if(Tcw<Tccw) printf("%lf\n",Tcw);
	else printf("%lf\n",Tccw);
	
	return 0;
}

Submission Info

Submission Time
Task A - 動く歩道
User RegFo
Language C (GCC 5.4.1)
Score 100
Code Size 454 Byte
Status AC
Exec Time 2 ms
Memory 128 KiB

Compile Error

./Main.c: In function ‘main’:
./Main.c:7:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d %d %d %d",&L,&X,&Y,&S,&D);
  ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 4
AC × 16
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt
Case Name Status Exec Time Memory
01.txt AC 2 ms 128 KiB
02.txt AC 2 ms 128 KiB
03.txt AC 2 ms 128 KiB
04.txt AC 2 ms 128 KiB
05.txt AC 2 ms 128 KiB
06.txt AC 2 ms 128 KiB
07.txt AC 2 ms 128 KiB
08.txt AC 2 ms 128 KiB
09.txt AC 2 ms 128 KiB
10.txt AC 2 ms 128 KiB
11.txt AC 2 ms 128 KiB
12.txt AC 2 ms 128 KiB
13.txt AC 2 ms 128 KiB
14.txt AC 2 ms 128 KiB
15.txt AC 2 ms 128 KiB
16.txt AC 2 ms 128 KiB
sample_01.txt AC 2 ms 128 KiB
sample_02.txt AC 2 ms 128 KiB
sample_03.txt AC 2 ms 128 KiB
sample_04.txt AC 2 ms 128 KiB