結果

問題 No.120 傾向と対策:門松列(その1)
ユーザー あかりきあかりき
提出日時 2021-02-13 14:27:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 365 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 80,188 KB
最終ジャッジ日時 2023-09-27 22:55:40
合計ジャッジ時間 2,848 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import collections
t=int(input())
for i in range(t):
  n=int(input())
  l=list(map(int,input().split()))
  l=collections.Counter(l)
  l=list(l.values())
  l.sort()
  l.reverse()
  ans=0
  for i in range(n//3+1):
    ct=0
    for j in range(len(l)):
      if l[j]>0:
        ct+=1
        l[j]-=1
      if ct==3:
        break
    if ct==3:
      ans+=1
  print(ans)
0