結果
問題 | No.67 よくある棒を切る問題 (1) |
ユーザー |
![]() |
提出日時 | 2017-04-21 02:53:01 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 438 ms / 5,000 ms |
コード長 | 944 bytes |
コンパイル時間 | 1,037 ms |
コンパイル使用メモリ | 118,640 KB |
実行使用メモリ | 51,560 KB |
最終ジャッジ日時 | 2025-03-03 10:40:35 |
合計ジャッジ時間 | 12,304 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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(' '); } }