Submission #736010
Source Code Expand
import java.io.*;
public class Main{
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) throws IOException{
String inputs[] = br.readLine().split(" ");
double L = new Double(inputs[0]);
double X = new Double(inputs[1]);
double Y = new Double(inputs[2]);
double S = new Double(inputs[3]);
double D = new Double(inputs[4]);
double l1=0, l2 = 0;
if (S<=D) {
l1 = D - S;
l2 = L - l1;
}else {
l2 = S - D;
l1 = L - l2;
}
double t1 = l1/(X+Y);
double t2 = l2/(Y-X);
if (t2 < 0){
System.out.println(t1);
}else{
System.out.println(Math.min(t1, t2));
}
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - 動く歩道 |
| User | haqishen |
| Language | Java7 (OpenJDK 1.7.0) |
| Score | 100 |
| Code Size | 700 Byte |
| Status | AC |
| Exec Time | 250 ms |
| Memory | 7764 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| 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 | 167 ms | 7636 KiB |
| 02.txt | AC | 168 ms | 7760 KiB |
| 03.txt | AC | 163 ms | 7636 KiB |
| 04.txt | AC | 167 ms | 7760 KiB |
| 05.txt | AC | 165 ms | 7636 KiB |
| 06.txt | AC | 167 ms | 7764 KiB |
| 07.txt | AC | 250 ms | 7764 KiB |
| 08.txt | AC | 167 ms | 7764 KiB |
| 09.txt | AC | 165 ms | 7764 KiB |
| 10.txt | AC | 167 ms | 7764 KiB |
| 11.txt | AC | 169 ms | 7764 KiB |
| 12.txt | AC | 164 ms | 7764 KiB |
| 13.txt | AC | 169 ms | 7764 KiB |
| 14.txt | AC | 166 ms | 7636 KiB |
| 15.txt | AC | 167 ms | 7764 KiB |
| 16.txt | AC | 167 ms | 7636 KiB |
| sample_01.txt | AC | 168 ms | 7764 KiB |
| sample_02.txt | AC | 168 ms | 7636 KiB |
| sample_03.txt | AC | 183 ms | 7764 KiB |
| sample_04.txt | AC | 203 ms | 7764 KiB |