結果
問題 |
No.120 傾向と対策:門松列(その1)
|
ユーザー |
|
提出日時 | 2018-06-20 22:19:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 483 bytes |
コンパイル時間 | 1,340 ms |
コンパイル使用メモリ | 163,936 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 17:27:58 |
合計ジャッジ時間 | 2,567 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 4 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ int t,n,in; cin >> t; for(int i=0;i<t;i++){ vector<int> v(101,0); cin >> n; for(int j=0;j<n;j++) cin>>in,v[in]++; sort(v.begin(),v.end(),greater<int>()); int cnt=0; while(v[0]!=0&&v[1]!=0&&v[2]!=0){ cnt+=v[2];v[0]-=v[2];v[1]-=v[2];v[2]=0; sort(v.begin(),v.end(),greater<int>()); } cout << cnt << endl; } return 0; }