結果

問題 No.29 パワーアップ
ユーザー te-sh
提出日時 2016-08-27 04:24:36
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 476 bytes
コンパイル時間 749 ms
コンパイル使用メモリ 101,632 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-12 03:41:42
合計ジャッジ時間 1,308 ms
ジャッジサーバーID
(参考情報)
judge3 / 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