結果
問題 | No.120 傾向と対策:門松列(その1) |
ユーザー |
![]() |
提出日時 | 2019-01-02 00:21:52 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 177 ms / 5,000 ms |
コード長 | 650 bytes |
コンパイル時間 | 81 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-14 04:14:50 |
合計ジャッジ時間 | 1,235 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 |
ソースコード
T = int(input()) #s = [[int(j) for j in input().split()] for i in range(N)] for i in range(T): N = int(input()) L = [int(i) for i in input().split()] amount = sorted([L.count(num) for num in set(L)]) if len(amount)<3: print(0) continue low = sum(amount[:-2]) mid = amount[-2] high = amount[-1] if low<=mid: #print("mid") print(low) else: #print("now: low.",low," mid.",mid," high",high) low -= mid high -= mid if low <= high*2: #print("high") print(mid+low//2) else: #print("low") print(N//3)