結果

問題 No.29 パワーアップ
ユーザー Y_S
提出日時 2020-07-25 07:09:24
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 551 bytes
コンパイル時間 743 ms
コンパイル使用メモリ 76,264 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 09:52:59
合計ジャッジ時間 1,694 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>	//cin, cout
#include <vector>	//vector
#include <algorithm> //sort,min,max
#include <string>	//string
#include <ios>		//fixed
#include <iomanip>	//setprecision
#include <utility> //swap

using namespace std;

int main() {

	int N;
	cin >> N;

	vector<int> A(11);

	int temp;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < 3; j++) {
			cin >> temp;
			A[temp]++;
		}
	}
	
	int ans = 0;
	temp = 0;
	for (int i = 1; i < 11; i++) {
		ans += A[i] / 2;
		temp += A[i] % 2;
	}

	ans += temp / 4;
	cout << ans << endl;

	return 0;

}
0