結果
問題 | No.120 傾向と対策:門松列(その1) |
ユーザー | roiti46 |
提出日時 | 2015-02-10 00:35:13 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 379 ms / 5,000 ms |
コード長 | 366 bytes |
コンパイル時間 | 43 ms |
コンパイル使用メモリ | 6,516 KB |
実行使用メモリ | 6,136 KB |
最終ジャッジ日時 | 2023-09-05 21:32:50 |
合計ジャッジ時間 | 1,907 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 259 ms
5,948 KB |
testcase_01 | AC | 368 ms
6,020 KB |
testcase_02 | AC | 150 ms
5,924 KB |
testcase_03 | AC | 379 ms
6,136 KB |
ソースコード
T = int(raw_input()) for loop in xrange(T): N = int(raw_input()) L = map(int,raw_input().split()) L = sorted([[L.count(i),i] for i in set(L)])[::-1] ans = 0 while len(L) >= 3: for i in range(3)[::-1]: L[i][0] -= 1 if L[i][0] == 0: L.pop(i) L = sorted(L)[::-1] ans += 1 print ans