結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー tsushimatsushima
提出日時 2020-01-02 20:54:22
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 261 ms / 5,000 ms
コード長 772 bytes
コンパイル時間 4,078 ms
コンパイル使用メモリ 108,860 KB
実行使用メモリ 44,672 KB
最終ジャッジ日時 2024-04-26 00:54:19
合計ジャッジ時間 11,391 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 258 ms
44,672 KB
testcase_01 AC 26 ms
20,096 KB
testcase_02 AC 111 ms
27,520 KB
testcase_03 AC 192 ms
37,120 KB
testcase_04 AC 247 ms
37,120 KB
testcase_05 AC 243 ms
37,120 KB
testcase_06 AC 242 ms
36,992 KB
testcase_07 AC 252 ms
40,064 KB
testcase_08 AC 260 ms
39,936 KB
testcase_09 AC 247 ms
40,064 KB
testcase_10 AC 215 ms
36,352 KB
testcase_11 AC 230 ms
36,736 KB
testcase_12 AC 225 ms
35,840 KB
testcase_13 AC 241 ms
39,168 KB
testcase_14 AC 238 ms
39,424 KB
testcase_15 AC 215 ms
38,400 KB
testcase_16 AC 240 ms
37,248 KB
testcase_17 AC 234 ms
36,992 KB
testcase_18 AC 241 ms
36,992 KB
testcase_19 AC 254 ms
40,064 KB
testcase_20 AC 261 ms
40,064 KB
testcase_21 AC 257 ms
40,192 KB
testcase_22 AC 229 ms
36,608 KB
testcase_23 AC 235 ms
36,608 KB
testcase_24 AC 28 ms
19,968 KB
testcase_25 AC 38 ms
20,864 KB
testcase_26 AC 34 ms
20,608 KB
testcase_27 AC 34 ms
20,352 KB
testcase_28 AC 69 ms
22,784 KB
testcase_29 AC 50 ms
22,016 KB
testcase_30 AC 36 ms
20,736 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var L = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var K = long.Parse(Console.ReadLine());

            var ng = 0D;
            var ok = 1000000000D;

            for (var i = 0; i < 100; i++)
            {
                var mid = (double)((ok + ng) / 2);
                var tmp = 0L;
                for (var j = 0; j < N; j++)
                    tmp += (long)(L[j] / mid);

                if (tmp >= K) ng = mid;
                else ok = mid;
            }

            Console.WriteLine(ng);

        }
    }
}
0