結果

問題 No.2524 Stripes
ユーザー 千葉祐輝
提出日時 2023-11-01 11:24:51
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 409 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 16,640 KB
最終ジャッジ日時 2024-09-25 17:54:26
合計ジャッジ時間 8,873 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other TLE * 1 -- * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

N = int(input())
S = input()

for i in range(1, N + 1):
    cnt = 0
    for combi in itertools.combinations(S, i):
        prev_color = ''
        match_flg = True
        for color in combi:
            if color == prev_color:
                match_flg = False
            else:
                prev_color = color
        if match_flg:
            cnt += 1
    print(cnt)
0