結果

問題 No.146 試験監督(1)
コンテスト
ユーザー kiridaruma
提出日時 2016-11-10 13:27:09
言語 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  
実行時間 -
コード長 306 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 503 ms
コンパイル使用メモリ 86,560 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2026-03-05 08:31:06
合計ジャッジ時間 972 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.d(9): Deprecation: `long += double` is performing truncating conversion
        sum += ceil(input[0] / 2.0) * 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(int i;0..n){
        auto input = readln.strip.split.map!(to!int).array;
        sum += ceil(input[0] / 2.0) * input[1];
    }
    writeln(sum);
}
0