結果

問題 No.120 傾向と対策:門松列(その1)
ユーザー trineutrontrineutron
提出日時 2021-02-23 13:34:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 304 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 11,824 KB
実行使用メモリ 10,148 KB
最終ジャッジ日時 2023-10-22 07:53:23
合計ジャッジ時間 1,058 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

from collections import defaultdict

def solve():
    n = int(input())
    l = list(map(int, input().split()))
    d = defaultdict(int)
    for x in l:
        d[x] += 1
    v = list(d.values())
    v.sort(reverse=True)
    print(min(n // 3, sum(v[2:])))

t = int(input())
for i in range(t):
    solve()
0