結果
| 問題 |
No.67 よくある棒を切る問題 (1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-09-05 12:16:14 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 602 bytes |
| コンパイル時間 | 4,397 ms |
| コンパイル使用メモリ | 146,536 KB |
| 実行使用メモリ | 13,116 KB |
| 最終ジャッジ日時 | 2025-03-03 10:36:07 |
| 合計ジャッジ時間 | 27,430 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 RE * 16 |
ソースコード
import std.algorithm, std.array, std.container, std.range, std.bitmanip;
import std.numeric, std.math, std.bigint, std.random, core.bitop;
import std.string, std.conv, std.stdio, std.typecons;
void main()
{
auto n = readln.chomp.to!long;
auto li = readln.split.map!(to!long);
auto k = readln.chomp.to!long;
auto maxL = li.reduce!(max);
bool calc(real x, real _) {
auto c = 0;
foreach (l; li)
c += (l / x).floor.to!long;
return c >= k;
}
auto eps = 10.to!real ^^ (-10);
auto r = iota(eps, maxL, eps).assumeSorted!(calc).lowerBound(0);
writefln("%.9f", r.back);
}