結果
| 問題 |
No.120 傾向と対策:門松列(その1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-02-10 01:00:53 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 658 bytes |
| コンパイル時間 | 219 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-12-26 02:39:39 |
| 合計ジャッジ時間 | 1,617 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 4 |
ソースコード
import sys
from collections import Counter
def debug(x, table):
for name, val in table.items():
if x is val:
print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
return None
def solve():
T = int(input())
for i in range(T):
N = int(input())
Ls = [int(i) for i in input().split()]
cnt = Counter(Ls)
ans = 0
while len(cnt) >= 3:
ans += 1
kdmt = list(cnt.keys())[:3]
for i in kdmt:
cnt[i] -= 1
if cnt[i] == 0:
del cnt[i]
print(ans)
if __name__ == '__main__':
solve()