結果

問題 No.1478 Simple Sugoroku
ユーザー さかぽんさかぽん
提出日時 2021-04-16 22:56:03
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 486 bytes
コンパイル時間 3,030 ms
コンパイル使用メモリ 105,928 KB
実行使用メモリ 33,436 KB
最終ジャッジ日時 2023-09-16 02:08:13
合計ジャッジ時間 8,835 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
22,632 KB
testcase_01 AC 63 ms
24,880 KB
testcase_02 AC 62 ms
22,788 KB
testcase_03 AC 62 ms
22,632 KB
testcase_04 AC 62 ms
22,784 KB
testcase_05 AC 62 ms
22,752 KB
testcase_06 AC 59 ms
20,720 KB
testcase_07 AC 62 ms
22,736 KB
testcase_08 AC 62 ms
22,772 KB
testcase_09 AC 59 ms
20,628 KB
testcase_10 AC 62 ms
22,828 KB
testcase_11 AC 62 ms
22,856 KB
testcase_12 AC 62 ms
22,784 KB
testcase_13 AC 110 ms
33,416 KB
testcase_14 AC 108 ms
31,188 KB
testcase_15 AC 111 ms
33,348 KB
testcase_16 AC 111 ms
31,416 KB
testcase_17 AC 112 ms
31,268 KB
testcase_18 AC 110 ms
31,292 KB
testcase_19 AC 111 ms
29,296 KB
testcase_20 AC 111 ms
33,360 KB
testcase_21 AC 111 ms
31,256 KB
testcase_22 AC 112 ms
31,332 KB
testcase_23 AC 113 ms
33,436 KB
testcase_24 AC 112 ms
31,360 KB
testcase_25 AC 111 ms
31,392 KB
testcase_26 AC 111 ms
31,312 KB
testcase_27 AC 111 ms
31,372 KB
testcase_28 AC 102 ms
31,752 KB
testcase_29 AC 104 ms
30,116 KB
testcase_30 AC 105 ms
32,116 KB
testcase_31 AC 104 ms
30,240 KB
testcase_32 AC 104 ms
32,148 KB
testcase_33 AC 105 ms
30,464 KB
testcase_34 AC 107 ms
32,512 KB
testcase_35 AC 107 ms
32,548 KB
testcase_36 AC 107 ms
28,448 KB
testcase_37 AC 109 ms
31,064 KB
testcase_38 AC 108 ms
31,008 KB
testcase_39 AC 108 ms
30,944 KB
testcase_40 AC 108 ms
30,868 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class C
{
	static int[] Read() => Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
	static (int, int) Read2() { var a = Read(); return (a[0], a[1]); }
	static void Main()
	{
		var (n, m) = Read2();
		var b = Read();

		var dp = new double[m];
		dp[^1] = n - b[^1];
		var sum = m + dp[^1];

		for (int i = m - 2; i >= 0; i--)
		{
			dp[i] = Math.Min(dp[i + 1] + b[i + 1] - b[i], sum / (m - i - 1));
			sum += dp[i];
		}
		Console.WriteLine(dp[0] + b[0] - 1);
	}
}
0