結果

問題 No.29 パワーアップ
ユーザー kokatsu
提出日時 2022-09-21 22:15:39
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 377 bytes
コンパイル時間 2,158 ms
コンパイル使用メモリ 205,728 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-22 16:16:39
合計ジャッジ時間 2,519 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int N;
    readf("%d\n", N);

    auto cnts = new int[](11);
    foreach (_; 0 .. N) {
        int a, b, c;
        readf("%d %d %d\n", a, b, c);

        ++cnts[a], ++cnts[b], ++cnts[c];
    }

    int res;
    foreach (ref cnt; cnts) {
        int d = cnt / 2;
        res += d, cnt -= d * 2;
    }

    res += cnts.sum / 4;

    res.writeln;
}
0