結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  motxx | 
| 提出日時 | 2014-12-03 03:18:59 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 500 bytes | 
| コンパイル時間 | 1,111 ms | 
| コンパイル使用メモリ | 159,100 KB | 
| 実行使用メモリ | 7,716 KB | 
| 最終ジャッジ日時 | 2025-10-24 20:51:11 | 
| 合計ジャッジ時間 | 1,954 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
int main() {
  
  int N; cin >> N;
  vector<int> items(10);
  rep(_, N) {
    int a, b, c;
    cin >> a >> b >> c; a--, b--, c--;
    items[a] ++, items[b] ++, items[c] ++;
  }
  
  int ans = 0;
  int remain = 0;
  rep(i, 10) {
    ans += items[i] / 2;
    remain += items[i] % 2;
  }
  ans += remain / 4;
  
  cout << ans << endl;
  
  return 0;
}
            
            
            
        