結果
| 問題 | No.91 赤、緑、青の石 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-30 13:25:57 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 531 bytes |
| 記録 | |
| コンパイル時間 | 784 ms |
| コンパイル使用メモリ | 107,172 KB |
| 実行使用メモリ | 7,852 KB |
| 最終ジャッジ日時 | 2025-12-07 12:26:37 |
| 合計ジャッジ時間 | 1,937 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 29 |
ソースコード
import std.algorithm, std.array, std.container, std.range;
import std.string, std.conv, std.bigint, std.math, std.random;
import std.stdio, std.typecons;
const auto max = 10 ^^ 7;
void main()
{
auto rgb = readln.split.map!(to!int);
bool calc(int i, int _)
{
auto a = rgb.map!(x => x - i);
auto b = a.filter!(x => x > 0).map!(x => x / 2).sum;
auto c = a.filter!(x => x < 0).map!(x => -x).sum;
return b >= c;
}
auto r = iota(max + 1).map!(to!int).assumeSorted!(calc).lowerBound(0);
writeln(r.back);
}