結果
| 問題 | No.120 傾向と対策:門松列(その1) | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-08-18 14:41:19 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 435 bytes | 
| コンパイル時間 | 2,621 ms | 
| コンパイル使用メモリ | 200,192 KB | 
| 最終ジャッジ日時 | 2025-01-13 03:06:39 | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| 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()>2){
			int abc=0;
			for(auto&&j:m){
				++abc,--j.second;
				if(j.second==0)m.erase(j.first);
				if(abc==3){
					++ans;
					break;
				}
			}
		}
		cout<<ans<<"\n"s;
	}
}
            
            
            
        