結果
問題 | 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 |
ソースコード
import itertoolsN = int(input())S = input()for i in range(1, N + 1):cnt = 0for combi in itertools.combinations(S, i):prev_color = ''match_flg = Truefor color in combi:if color == prev_color:match_flg = Falseelse:prev_color = colorif match_flg:cnt += 1print(cnt)