結果
| 問題 |
No.120 傾向と対策:門松列(その1)
|
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2016-04-04 19:32:18 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 363 ms / 5,000 ms |
| コード長 | 647 bytes |
| コンパイル時間 | 174 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-10-04 00:51:43 |
| 合計ジャッジ時間 | 2,379 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import array
import collections
def compute_maximum(bamboos):
answer = 0
counter = collections.Counter(bamboos)
if len(counter) < 3:
return answer
while True:
cands = counter.most_common(3)
if cands[-1][1] <= 0:
return answer
used = (cand[0] for cand in cands)
counter.subtract(used)
answer += 1
def main():
t = int(input())
for _ in range(t):
_ = int(input())
bamboos = array.array("L", map(int, input().split()))
print(compute_maximum(bamboos))
if __name__ == '__main__':
main()
はむ吉🐹