結果

問題 No.29 パワーアップ
コンテスト
ユーザー te-sh
提出日時 2016-08-27 04:24:36
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 476 bytes
コンパイル時間 654 ms
コンパイル使用メモリ 88,624 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-24 20:58:33
合計ジャッジ時間 1,393 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

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 abci = iota(n).map!(i => readln.split.map!(to!int).map!(i => i - 1));

  auto items = [0,0,0,0,0,0,0,0,0,0];
  foreach (abc; abci) {
    foreach (i; abc) {
      items[i] += 1;
    }
  }

  auto r = 0;
  foreach (ref item; items) {
    r += item / 2;
    item %= 2;
  }

  writeln(r + count!("a == 1")(items) / 4);
}
0