結果

問題 No.29 パワーアップ
ユーザー RCCW
提出日時 2017-02-01 23:20:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 352 bytes
コンパイル時間 1,449 ms
コンパイル使用メモリ 157,720 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 02:22:06
合計ジャッジ時間 2,306 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
	int n;
	int z[10] = { 0 };

	cin >> n;

	for (int i = 0; i < n; i++) {
		int a, b, c;
		cin>>a>>b>>c;
		z[a - 1]++;
		z[b - 1]++;
		z[c - 1]++;
	}
	int tsum = 0;
	int fsum = 0;
	for (int j = 0; j < 10; j++) {
		tsum += z[j] / 2;
		fsum += z[j] % 2;
	}
	cout << tsum + fsum / 4 << endl;

}

0