結果

問題 No.120 傾向と対策:門松列(その1)
ユーザー nbisconbisco
提出日時 2017-01-21 22:44:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 561 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 10,944 KB
実行使用メモリ 8,404 KB
最終ジャッジ日時 2023-08-24 19:26:34
合計ジャッジ時間 6,838 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())

def kado():
    N = int(input())
    L = list(map(int, input().strip().split(" ")))
    total = 0
    for i in range(len(L)):
        if L[i] == 0:
            continue
        for j in range(i+1, len(L)):
            for k in range(j+1, len(L)):
                if L[i] == 0 or L[j] == 0 or L[k] == 0:
                    break
                if (L[i] != L[j]) and (L[j] != L[k]) and (L[k] != L[i]):
                    L[i] = L[j] = L[k] = 0
                    total += 1
    return total

print("\n".join([str(kado()) for i in range(T)]))
0