Submission #736802


Source Code Expand

#include <stdio.h>

int main()
{
  double
    L,   //歩道の長さ
    X,   //1秒間に床面が進む速度
    Y,   //高橋君がい秒間に進む速度
    S,   //高橋君の位置
    D;   //出口の位置

  double V1, V2, L1, L2;
  double T1, T2;


  scanf("%lf %lf %lf %lf %lf", &L, &X, &Y, &S, &D);


  /*時計回り*/
  V1 = X+Y;
  if(D >= S) L1 = D-S; else L1=(L-S)+D;
  T1 = (double)L1 / V1;
  /*反時計回り*/
  if (Y > X) {
    V2 = Y -X; L2 =S+(L-D);
    T2 =(double)L2 / V2;
  } else T2 = 0;

  if (D==S){printf("0.0000000000\n");}

  if ( T2 == 0) printf("%.10lf\n", T1);
  else if (T1 <= T2)   printf("%.10lf\n", T1);
  else if (T1 > T2)  printf("%.10lf\n", T2);

}

Submission Info

Submission Time
Task A - 動く歩道
User bogard
Language C (GCC 5.4.1)
Score 0
Code Size 729 Byte
Status WA
Exec Time 2 ms
Memory 128 KiB

Compile Error

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

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 100
Status
AC × 4
AC × 12
WA × 4
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 WA 2 ms 128 KiB
04.txt AC 2 ms 128 KiB
05.txt WA 2 ms 128 KiB
06.txt AC 2 ms 128 KiB
07.txt AC 2 ms 128 KiB
08.txt WA 2 ms 128 KiB
09.txt AC 2 ms 128 KiB
10.txt AC 2 ms 128 KiB
11.txt WA 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