結果

問題 No.29 パワーアップ
ユーザー nanaenanae
提出日時 2018-01-03 10:44:04
言語 D
(dmd 2.106.1)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 388 bytes
コンパイル時間 468 ms
コンパイル使用メモリ 111,868 KB
最終ジャッジ日時 2024-04-27 02:30:42
合計ジャッジ時間 912 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/std/algorithm/iteration.d(974): Error: template `D main.__lambda5` is not callable using argument types `!()(int, uint)`
Main.d(7):        Candidate is: `__lambda5(__T2)(x)`
Main.d(7): Error: template instance `Main.main.each!(Group!("a == b", SortedRange!(int[], "a < b", SortedRangeOptions.assumeSorted)))` error instantiating

ソースコード

diff #

import std.stdio, std.string, std.conv, std.algorithm, std.numeric;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;

void main() {
    int n = readln.chomp.to!int;
    int level, amari;
    iota(n).map!(i => readln.split.to!(int[])).array.joiner.array.sort().group.each!(x => (level += x[1]/2, amari += x[1]%2));
    level += amari/4;
    writeln(level);
}
0