結果

問題 No.29 パワーアップ
コンテスト
ユーザー nanae
提出日時 2018-01-03 10:44:04
言語 D
(dmd 2.112.0)
コンパイル:
dmd -fPIE -m64 -w -wi -O -release -inline -I/opt/dmd/src/druntime/import/ -I/opt/dmd/src/phobos -L-L/opt/dmd/linux/lib64/ -fPIC _filename_
実行:
./Main
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 388 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 987 ms
コンパイル使用メモリ 89,984 KB
最終ジャッジ日時 2026-07-15 22:00:23
合計ジャッジ時間 1,693 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/std/algorithm/iteration.d(1165): Error: template `__lambda_L7_C86` is not callable using argument types `!()(int, uint)`
                    cast(void) fun(range.front.expand);
                                  ^
Main.d(7):        Candidate is: `__lambda_L7_C86(__T2)(x)`
    iota(n).map!(i => readln.split.to!(int[])).array.joiner.array.sort().group.each!(x => (level += x[1]/2, amari += x[1]%2));
                                                                                     ^
Main.d(7): Error: template instance `Main.main.each!(Group!("a == b", SortedRange!(int[], "a < b", SortedRangeOptions.assumeSorted)))` error instantiating
    iota(n).map!(i => readln.split.to!(int[])).array.joiner.array.sort().group.each!(x => (level += x[1]/2, amari += x[1]%2));
                                                                              ^

ソースコード

diff #
raw source code

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