結果
| 問題 | No.120 傾向と対策:門松列(その1) | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-01-08 23:35:34 | 
| 言語 | Python2 (2.7.18) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 666 bytes | 
| コンパイル時間 | 694 ms | 
| コンパイル使用メモリ | 7,040 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-13 03:19:36 | 
| 合計ジャッジ時間 | 1,823 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 4 | 
ソースコード
#!/usr/bin/env python
def read():
    return input(), map(int, raw_input().split())
def work((N, vList)):
    vList.sort()
    used = [False for i in range(N)]
    
    A = 0
    B = 1
    C = 2
    ans = 0
    
    while max(A, B, C) < N:
        while A < N and used[A]:
            A += 1
        while max(A, B) < N and (vList[B] <= vList[A] or used[B]):
            B += 1
        while max(A, B, C) < N and (vList[C] <= vList[B] or used[C]):
            C += 1
        if max(A, B, C) < N:
            ans += 1
            used[A] = used[B] = used[C] = True
    print ans
if __name__ == "__main__":
    for i in range(input()):
        work(read())
            
            
            
        