結果

問題 No.35 タイパー高橋
ユーザー te-shte-sh
提出日時 2016-08-27 13:23:22
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 551 bytes
コンパイル時間 901 ms
コンパイル使用メモリ 93,512 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-09-02 21:25:09
合計ジャッジ時間 1,183 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,368 KB
testcase_01 AC 2 ms
4,372 KB
testcase_02 AC 3 ms
4,372 KB
testcase_03 AC 3 ms
4,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

void main()
{
  auto n = readln.chomp.to!int;
  auto tsi = iota(n).map!((i) {
    auto s = readln.split;
    return tuple(s[0].to!int, s[1]);
  });

  auto ai = tsi.map!((ts) {
    auto t = ts[0];
    auto s = ts[1].length.to!int;
    auto u = min(t * 12 / 1000, s);
    auto w = max(s - u, 0);
    return tuple(u, w);
  });
  auto r = reduce!((a, b) { return tuple(a[0] + b[0], a[1] + b[1]); })(tuple(0, 0), ai);

  writeln(r[0], " ", r[1]);
}
0