結果
| 問題 | No.120 傾向と対策:門松列(その1) | 
| コンテスト | |
| ユーザー |  dnish | 
| 提出日時 | 2018-06-15 11:22:17 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 667 bytes | 
| コンパイル時間 | 1,692 ms | 
| コンパイル使用メモリ | 173,320 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-30 14:44:19 | 
| 合計ジャッジ時間 | 2,494 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 4 | 
ソースコード
#include "bits/stdc++.h"
#define REP(i,n,N) for(ll i=(n); i<(N); i++)
#define RREP(i,n,N) for(ll i=(N-1); i>=n; i--)
#define CK(n,a,b) (a)<=(n)&&(n)<(b)
#define ALL(v) (v).begin(),(v).end()
#define p(s) cout<<(s)<<endl
typedef long long ll;
using namespace std;
const ll inf =1e18;
int T;
int main(){
    while(cin>>T){
        REP(t,0,T){
            int N;
            cin>>N;
            int a[110];
            map<int,int> m;
            REP(i,0,N){
                cin>>a[i];
                m[a[i]]++;
            }
            int n=N/3;
            for(auto mm:m){
                N-=max(0,mm.second-n);
            }
            p(N/3);
        }
    }
}
            
            
            
        