結果

問題 No.29 パワーアップ
ユーザー NotationNap
提出日時 2015-04-30 05:39:45
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 427 bytes
コンパイル時間 1,039 ms
コンパイル使用メモリ 158,044 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-05 16:54:03
合計ジャッジ時間 1,665 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

typedef long long Int;
#define REP(i,n) for(int (i)=0;(i)<(int)(n);++(i))

int main() {
	int n; cin >> n;
	int item[10] = {};
	REP(i, n) {
		int a, b, c; cin >> a >> b >> c;
		item[a - 1]++;
		item[b - 1]++;
		item[c - 1]++;
	}
	
	int ans = 0;
	int remain = 0;
	REP(i, 10) {
		ans += item[i] / 2;
		item[i] %= 2;
		remain += item[i];
	}
	ans += remain / 4;
	cout << ans << endl;
}
0