結果

問題 No.29 パワーアップ
ユーザー hogeover30
提出日時 2015-01-29 02:08:58
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 405 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 57,164 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-23 03:44:25
合計ジャッジ時間 1,109 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int n;
    while (cin>>n) {
        int v[11]={};
        while (n--) {
            int a, b, c; cin>>a>>b>>c;
            ++v[a], ++v[b], ++v[c];
        }
        int res=0, x=0;
        for(int i=1;i<=10;++i) {
            res+=v[i]/2;
            x+=(v[i]%=2);
        }
        res+=x/4;
        cout<<res<<endl;
    }
}
0