結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2016-02-17 22:41:49 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 516 bytes |
コンパイル時間 | 744 ms |
コンパイル使用メモリ | 107,116 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 02:52:26 |
合計ジャッジ時間 | 1,642 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
import std.stdio, std.conv, std.string, std.range, std.algorithm; void main() { auto N = readln.strip.to!int; int[] A, B, C; foreach (_; 0 .. N) { auto input = readln.split.to!(int[]); A ~= input[0]; B ~= input[1]; C ~= input[2]; } auto inventory = new int[11]; int ans; chain(A, B, C).each!(item => inventory[item]++); ans = inventory.map!"a/2".sum; ans += inventory.map!"a%2".count!"a>0" / 4; ans.writeln; }