結果

問題 No.81 すべて足すだけの簡単なお仕事です。
コンテスト
ユーザー diginatu
提出日時 2014-11-28 00:48:13
言語 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
結果
WA  
実行時間 -
コード長 554 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 743 ms
コンパイル使用メモリ 88,972 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-03-05 05:49:18
合計ジャッジ時間 1,626 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

void main(){
  auto N = readln().strip().to!int();
  long ansi;
  real ansd = 0;
  foreach(immutable int i; 0 .. N) {
    auto t = readln().strip().to!real();
    auto ti = t.to!long();
    ansi += ti;
    ansd += t - ti;

    auto td = ansd.to!long();
    ansi += td;
    ansd -= td;
  }

  write(ansi, ".");
  foreach(int i; 0 .. 10) {
    ansd *= 10;
    auto t = ansd.to!int();
    ansd -= t;
    write(t);
  }

  writeln();
}
0