結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  mmn15277198 | 
| 提出日時 | 2020-08-05 04:18:50 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 614 bytes | 
| コンパイル時間 | 785 ms | 
| コンパイル使用メモリ | 103,420 KB | 
| 実行使用メモリ | 7,716 KB | 
| 最終ジャッジ日時 | 2025-10-24 21:15:32 | 
| 合計ジャッジ時間 | 1,543 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
#pragma GCC optimize("Ofast")
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>
using namespace std;
int main(){	
	
	int n;
	cin >> n;
	vector<int> check(11,0);
	for(int i=0;i<n;i++){
		for(int j=0;j<3;j++){
			int now;
			cin >> now;
			check[now]++;
		}
	}
	int ans=0;
	for(int i=1;i<=10;i++){
		int point=check[i]/2;
		ans+=point;
		check[i]-=point*2;
	}
	int cnt=0;
	for(int i=1;i<=10;i++){
		if(check[i]==1){
			cnt++;
		}
		if(cnt==4){
			ans++;
			cnt=0;
		}
	}
	cout << ans << endl;
	return 0;
}
            
            
            
        