結果

問題 No.120 傾向と対策:門松列(その1)
ユーザー pluto77pluto77
提出日時 2017-02-10 09:08:21
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 365 bytes
コンパイル時間 573 ms
コンパイル使用メモリ 6,644 KB
実行使用メモリ 6,640 KB
最終ジャッジ日時 2023-08-27 05:17:32
合計ジャッジ時間 2,180 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#yuki_120
from collections import Counter

n=int(raw_input())
for i in xrange(n):
 int(raw_input())
 s=Counter(map(int,raw_input().split())).values()
 s=sorted(s,reverse=True)
 res=0
 if len(s)>=3:
  while True:
   if s[0] and s[1] and s[2]:
    s[0]-=1
    s[1]-=1
    s[2]-=1
    res+=1
   else:
    s=sorted(s,reverse=True)
    if s[2]==0:
     break
 print res
0