結果
| 問題 |
No.120 傾向と対策:門松列(その1)
|
| コンテスト | |
| ユーザー |
matsu7874
|
| 提出日時 | 2016-01-01 08:43:03 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 493 bytes |
| コンパイル時間 | 210 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-09-19 09:07:37 |
| 合計ジャッジ時間 | 1,441 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 4 |
ソースコード
import heapq
import collections
T=int(input())
for _ in range(T):
N = int(input())
L = collections.Counter(list(map(int, input().split())))
q = [100-v for k,v in L.items()]
cnt = 0
while len(q)>=3:
a = heapq.heappop(q)
b = heapq.heappop(q)
c = heapq.heappop(q)
cnt += 1
if a<100:
heapq.heappush(q,a+1)
if b<100:
heapq.heappush(q,b+1)
if c<100:
heapq.heappush(q,c+1)
print(cnt)
matsu7874