結果
| 問題 |
No.67 よくある棒を切る問題 (1)
|
| コンテスト | |
| ユーザー |
mban
|
| 提出日時 | 2017-04-21 02:50:29 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 942 bytes |
| コンパイル時間 | 974 ms |
| コンパイル使用メモリ | 112,276 KB |
| 実行使用メモリ | 51,548 KB |
| 最終ジャッジ日時 | 2025-03-03 10:40:23 |
| 合計ジャッジ時間 | 9,878 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 RE * 16 |
コンパイルメッセージ
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;
int cnt = L.Sum(ii => ((int)(ii / mid)));
if (cnt < K)
{
max = mid;
}
else
{
min = mid;
}
}
Console.WriteLine(max);
}
static string[] Line()
{
return Console.ReadLine().Split(' ');
}
}
mban