結果

問題 No.120 傾向と対策:門松列(その1)
ユーザー evawenisevawenis
提出日時 2020-08-18 14:35:46
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 470 bytes
コンパイル時間 2,022 ms
コンパイル使用メモリ 205,152 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-20 07:33:53
合計ジャッジ時間 3,270 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
	}
}
0