提出 #736121
ソースコード 拡げる
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
public static List<int> intread(){
List<int> x = new List<int>();
string[] a = Console.ReadLine().Split(' ');
foreach (string k in a)
{
x.Add(int.Parse(k));
}
return x;
}
public static int[] intstring()
{
var a = Console.ReadLine().Split(' ').Select(elm => int.Parse(elm)).ToArray();
return a;
}
public static char[] charlist(string a)
{
char[]b = a.ToCharArray();
return b;
}
static void Main(string[] args)
{
List<int> a = intread();
double len = a[0];
double sp = a[1];
double taka = a[2];
double start = a[3];
double goal = a[4];
double cw;
double lcw;
if (goal > start)
{
cw = (double)((goal - start) / (sp + taka));
lcw = (double)((start + len - goal) / (taka - sp));
}
else
{
cw = (double)((len - start + goal) / (sp + taka));
lcw = (double)((start - goal) / (taka - sp));
}
double ans;
if (taka < sp)
ans = cw;
else
{
if (cw > lcw)
ans = lcw;
else
ans = cw;
}
Console.WriteLine(ans.ToString("R10"));
}
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - 動く歩道 |
| ユーザ | udonudon |
| 言語 | C# (Mono 4.6.2.0) |
| 得点 | 100 |
| コード長 | 1820 Byte |
| 結果 | AC |
| 実行時間 | 35 ms |
| メモリ | 2904 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01.txt | AC | 33 ms | 2904 KiB |
| 02.txt | AC | 31 ms | 2648 KiB |
| 03.txt | AC | 31 ms | 2648 KiB |
| 04.txt | AC | 31 ms | 2648 KiB |
| 05.txt | AC | 33 ms | 2648 KiB |
| 06.txt | AC | 33 ms | 2648 KiB |
| 07.txt | AC | 33 ms | 2648 KiB |
| 08.txt | AC | 33 ms | 2648 KiB |
| 09.txt | AC | 31 ms | 2648 KiB |
| 10.txt | AC | 32 ms | 2648 KiB |
| 11.txt | AC | 31 ms | 2648 KiB |
| 12.txt | AC | 32 ms | 2648 KiB |
| 13.txt | AC | 33 ms | 2648 KiB |
| 14.txt | AC | 31 ms | 2648 KiB |
| 15.txt | AC | 33 ms | 2648 KiB |
| 16.txt | AC | 33 ms | 2648 KiB |
| sample_01.txt | AC | 32 ms | 2648 KiB |
| sample_02.txt | AC | 34 ms | 2648 KiB |
| sample_03.txt | AC | 35 ms | 2648 KiB |
| sample_04.txt | AC | 33 ms | 2648 KiB |