結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー mbanmban
提出日時 2017-04-21 02:53:01
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 434 ms / 5,000 ms
コード長 944 bytes
コンパイル時間 1,949 ms
コンパイル使用メモリ 115,388 KB
実行使用メモリ 52,828 KB
最終ジャッジ日時 2024-04-25 23:49:59
合計ジャッジ時間 12,920 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 434 ms
52,828 KB
testcase_01 AC 31 ms
26,268 KB
testcase_02 AC 179 ms
34,476 KB
testcase_03 AC 316 ms
45,200 KB
testcase_04 AC 418 ms
45,184 KB
testcase_05 AC 419 ms
45,308 KB
testcase_06 AC 416 ms
43,008 KB
testcase_07 AC 419 ms
46,076 KB
testcase_08 AC 422 ms
48,380 KB
testcase_09 AC 421 ms
46,076 KB
testcase_10 AC 381 ms
44,220 KB
testcase_11 AC 399 ms
44,768 KB
testcase_12 AC 367 ms
44,028 KB
testcase_13 AC 387 ms
47,256 KB
testcase_14 AC 401 ms
43,608 KB
testcase_15 AC 364 ms
42,616 KB
testcase_16 AC 415 ms
45,192 KB
testcase_17 AC 413 ms
45,308 KB
testcase_18 AC 419 ms
43,256 KB
testcase_19 AC 421 ms
46,208 KB
testcase_20 AC 421 ms
46,200 KB
testcase_21 AC 424 ms
46,196 KB
testcase_22 AC 381 ms
44,368 KB
testcase_23 AC 400 ms
42,616 KB
testcase_24 AC 30 ms
25,900 KB
testcase_25 AC 42 ms
26,524 KB
testcase_26 AC 38 ms
26,652 KB
testcase_27 AC 36 ms
26,544 KB
testcase_28 AC 96 ms
28,464 KB
testcase_29 AC 66 ms
29,232 KB
testcase_30 AC 43 ms
26,644 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.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;

class Program
{
    static int N;
    static long K;
    static int[] L;

    static void Main(string[] args)
    {
        N = int.Parse(Console.ReadLine());
        L = Line().Select(int.Parse).ToArray();
        K = long.Parse(Console.ReadLine());

        double min = 0;
        double max = 1e9;
        for(int i = 0; i < 100; i++)
        {
            double mid = (min + max) / 2.0;
            long cnt = L.Sum(ii => ((long)(ii / mid)));
            if (cnt < K)
            {
                max = mid;
            }
            else
            {
                min = mid;
            }
        }

        Console.WriteLine(max);
    }

    static string[] Line()
    {
        return Console.ReadLine().Split(' ');
    }
}
0