結果

問題 No.120 傾向と対策:門松列(その1)
ユーザー dnishdnish
提出日時 2018-06-15 11:22:17
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 667 bytes
コンパイル時間 1,487 ms
コンパイル使用メモリ 171,580 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 04:33:17
合計ジャッジ時間 2,360 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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


}
0