結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー mbanmban
提出日時 2017-04-21 02:53:01
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 492 ms / 5,000 ms
コード長 944 bytes
コンパイル時間 5,366 ms
コンパイル使用メモリ 110,532 KB
実行使用メモリ 49,024 KB
最終ジャッジ日時 2023-08-08 06:15:52
合計ジャッジ時間 17,627 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 492 ms
49,024 KB
testcase_01 AC 68 ms
23,652 KB
testcase_02 AC 230 ms
32,536 KB
testcase_03 AC 370 ms
42,684 KB
testcase_04 AC 474 ms
38,860 KB
testcase_05 AC 475 ms
40,760 KB
testcase_06 AC 476 ms
42,844 KB
testcase_07 AC 480 ms
45,828 KB
testcase_08 AC 478 ms
47,844 KB
testcase_09 AC 480 ms
45,720 KB
testcase_10 AC 435 ms
40,164 KB
testcase_11 AC 456 ms
38,352 KB
testcase_12 AC 424 ms
39,688 KB
testcase_13 AC 446 ms
42,780 KB
testcase_14 AC 463 ms
43,136 KB
testcase_15 AC 423 ms
44,244 KB
testcase_16 AC 478 ms
40,844 KB
testcase_17 AC 479 ms
40,776 KB
testcase_18 AC 475 ms
40,756 KB
testcase_19 AC 482 ms
45,768 KB
testcase_20 AC 483 ms
45,780 KB
testcase_21 AC 482 ms
47,928 KB
testcase_22 AC 438 ms
42,020 KB
testcase_23 AC 458 ms
42,452 KB
testcase_24 AC 68 ms
23,724 KB
testcase_25 AC 82 ms
24,208 KB
testcase_26 AC 78 ms
24,064 KB
testcase_27 AC 77 ms
24,084 KB
testcase_28 AC 142 ms
27,904 KB
testcase_29 AC 106 ms
26,924 KB
testcase_30 AC 84 ms
24,200 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