結果

問題 No.2524 Stripes
ユーザー kinshyfishykinshyfishy
提出日時 2023-11-27 22:41:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 701 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 757,012 KB
最終ジャッジ日時 2023-11-27 22:41:26
合計ジャッジ時間 8,980 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 30 ms
10,112 KB
testcase_02 WA -
testcase_03 MLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
S=list(input())
A=[]

for i in range(1,N+1):       #1<=i<=Nについて問題を解く
    A.append([])
    if i==1:
        for j in range(1,N+1):
            A[0].append([[j,S[j-1]]])
    else:
        for j in range(0,len(A[0])):     #i-1番目のA[0]の結果すべて
            for k in range(A[0][j][i-2][0]+1,N):    #A[0]のうち最も大きなNの要素より大きくN以下にいるSを探す
                if A[0][j][i-2][1]!=S[k]:
                    A[1].append([])
                    for l in range(0,i-1):
                        A[1][len(A[1])-1].append(A[0][j][l])
                    A[1][len(A[1])-1].append([k,S[k]])
        A.remove(A[0])
    print(len(A[0]))
0