Submission #736262
Source Code Expand
import std.stdio;
void main()
{
int L,X,Y,S,D;
double ans;
readf("%d %d %d %d %d",&L,&X,&Y,&S,&D);
{
double speed=X+Y;
double len=D-S;
if(len<0){
len+=L;
}
ans=len/speed;
}
{
double speed=Y-X;
if(speed>0){
double len=S-D;
if(len<0){
len+=L;
}
double a=len/speed;
if(ans>a){
ans=a;
}
}
}
writefln("%.10f",ans);
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - 動く歩道 |
| User | ray45422 |
| Language | D (DMD64 v2.070.1) |
| Score | 100 |
| Code Size | 394 Byte |
| Status | AC |
| Exec Time | 4 ms |
| Memory | 256 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 | 4 ms | 256 KiB |
| 02.txt | AC | 3 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 | 4 ms | 256 KiB |
| 07.txt | AC | 4 ms | 256 KiB |
| 08.txt | AC | 4 ms | 256 KiB |
| 09.txt | AC | 3 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 | 3 ms | 256 KiB |
| sample_03.txt | AC | 4 ms | 256 KiB |
| sample_04.txt | AC | 4 ms | 256 KiB |