結果

問題 No.146 試験監督(1)
コンテスト
ユーザー kiridaruma
提出日時 2016-11-10 13:29:19
言語 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
結果
RE  
実行時間 -
コード長 301 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 550 ms
コンパイル使用メモリ 86,684 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-05 08:33:55
合計ジャッジ時間 948 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.d(9): Deprecation: `long += float` is performing truncating conversion
        sum += ceil(input[0] / 2f) * input[1];
            ^

ソースコード

diff #
raw source code

import std.stdio, std.conv, std.string;
import std.math, std.algorithm, std.array;

void main(){
    int n = readln.strip.to!int;
    long sum = 0;
    foreach(i;0..n){
        auto input = readln.strip.split.map!(to!int).array;
        sum += ceil(input[0] / 2f) * input[1];
    }
    writeln(sum);
}
0