結果
| 問題 |
No.120 傾向と対策:門松列(その1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-11 23:10:27 |
| 言語 | Python2 (2.7.18) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 469 bytes |
| コンパイル時間 | 39 ms |
| コンパイル使用メモリ | 6,912 KB |
| 実行使用メモリ | 7,040 KB |
| 最終ジャッジ日時 | 2024-07-06 15:46:59 |
| 合計ジャッジ時間 | 930 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 4 |
ソースコード
# -*- coding:utf-8 -*- import collections def solve(): n = input() L = map(int,raw_input().split()) cnt = collections.Counter(L) if len(set(L)) < 3: print 0 return no1 = cnt.most_common(1)[0][1] no2 = cnt.most_common(2)[1][1] print no1,no2 if no1 <= n /3.0: print n / 3 return else: if no2 > (n - no1)/2: print n - no1 - no2 return else: print (n-no1) / 2 return if __name__ == "__main__": t = input() for i in xrange(t): solve()