Submission #737068


Source Code Expand

#include <iostream>
using namespace std;

int main() {
	
	long long L,X,Y,S,D;
	cin >> L >> X >> Y >> S >> D;
	
	long long dd = (D-S+L)%L;

	long double ans = (long double)dd/(X+Y);
	
	if( Y>X ){
		long double a = (long double)(L-dd)/(Y-X);
		if(a<ans){
			ans = a;
		}
	}

	printf("%10.10llf\n",ans);
//	cout << ans << endl;
	
	// your code goes here
	return 0;
}

Submission Info

Submission Time
Task A - 動く歩道
User akino2012
Language C++14 (GCC 5.4.1)
Score 100
Code Size 388 Byte
Status AC
Exec Time 5 ms
Memory 256 KiB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:20:26: warning: use of ‘ll’ length modifier with ‘f’ type character [-Wformat=]
  printf("%10.10llf\n",ans);
                          ^

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 4 ms 256 KiB
02.txt AC 4 ms 256 KiB
03.txt AC 4 ms 256 KiB
04.txt AC 4 ms 256 KiB
05.txt AC 4 ms 256 KiB
06.txt AC 5 ms 256 KiB
07.txt AC 4 ms 256 KiB
08.txt AC 4 ms 256 KiB
09.txt AC 4 ms 256 KiB
10.txt AC 4 ms 256 KiB
11.txt AC 4 ms 256 KiB
12.txt AC 4 ms 256 KiB
13.txt AC 4 ms 256 KiB
14.txt AC 4 ms 256 KiB
15.txt AC 4 ms 256 KiB
16.txt AC 4 ms 256 KiB
sample_01.txt AC 4 ms 256 KiB
sample_02.txt AC 4 ms 256 KiB
sample_03.txt AC 4 ms 256 KiB
sample_04.txt AC 4 ms 256 KiB