結果

問題 No.29 パワーアップ
コンテスト
ユーザー anonymously
提出日時 2024-04-26 13:55:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 356 bytes
コンパイル時間 1,884 ms
コンパイル使用メモリ 195,636 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-24 21:20:42
合計ジャッジ時間 2,409 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
	int n;
	cin >> n;
	vector<int> items(10,0);
	while(n--){
		for(int i=0;i<3;i++){
			int a;
			cin >> a;
			items[a-1]++;
		}
	}
	int power_up=0;
	int residue=0;
	for(int i=0;i<10;i++){
		power_up+=items[i]/2;
		residue+=items[i]%2;
	}
	power_up+=residue/4;
	cout << power_up << endl;
	return 0;
}
0