結果
問題 | No.35 タイパー高橋 |
ユーザー |
|
提出日時 | 2016-08-27 13:23:22 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 551 bytes |
コンパイル時間 | 752 ms |
コンパイル使用メモリ | 106,880 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 03:42:14 |
合計ジャッジ時間 | 1,238 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 |
ソースコード
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]); }