結果
| 問題 | No.120 傾向と対策:門松列(その1) | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-08-18 14:35:46 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 470 bytes | 
| コンパイル時間 | 2,268 ms | 
| コンパイル使用メモリ | 202,656 KB | 
| 最終ジャッジ日時 | 2025-01-13 03:06:23 | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | RE * 4 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int t; cin>>t;
	for(int i=0;i<t;++i){
		int n; cin>>n;
		map<int,int>m;
		for(int j=0;j<n;++j){
			int l; cin>>l;
			++m[l];
		}
		int ans=0;
		while(m.size()){
			vector<int>abc;
			for(auto&&j:m){
				abc.emplace_back(j.first);
				--j.second;
				if(j.second==0)m.erase(j.first);
				if(abc.size()==3){
					++ans;
					break;
				}
			}
		}
		cout<<ans<<"\n"s;
	}
}
            
            
            
        