結果
| 問題 |
No.120 傾向と対策:門松列(その1)
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2024-11-21 23:32:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 314 bytes |
| コンパイル時間 | 430 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 77,824 KB |
| 最終ジャッジ日時 | 2024-11-21 23:32:14 |
| 合計ジャッジ時間 | 1,704 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 4 |
ソースコード
from collections import defaultdict
for _ in range(int(input())):
N = int(input())
L = list(map(int,input().split()))
dic = defaultdict(int)
for l in L:
dic[l] += 1
cnt = 0
N3 = N //3
for v in dic.values():
if v > N3:
cnt += v - N3
print((N - cnt)//3)
ntuda