結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  hotpepsi | 
| 提出日時 | 2015-03-29 00:38:16 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 521 bytes | 
| コンパイル時間 | 542 ms | 
| コンパイル使用メモリ | 69,172 KB | 
| 実行使用メモリ | 7,716 KB | 
| 最終ジャッジ日時 | 2025-10-24 20:52:00 | 
| 合計ジャッジ時間 | 1,240 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
#include <iostream>
#include <algorithm>
#include <sstream>
using namespace std;
int main(int argc, char *argv[])
{
  string s;
  getline(cin, s);
  int N = atoi(s.c_str());
  int cnt[16] = {};
  for (int i = 0; i < N; ++i) {
	  getline(cin, s);
	  stringstream ss(s);
	  int a, b, c;
	  ss >> a >> b >> c;
	  cnt[a] += 1;
	  cnt[b] += 1;
	  cnt[c] += 1;
  }
  int ans = 0;
  int c = 0;
  for (int i = 0; i < 16; ++i) {
	  ans += cnt[i] / 2;
	  c += cnt[i] % 2;
  }
  ans += c / 4;
  cout << ans << endl;
  return 0;
}
            
            
            
        