結果
問題 | No.2524 Stripes |
ユーザー |
|
提出日時 | 2023-11-27 22:41:17 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 701 bytes |
コンパイル時間 | 126 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 714,112 KB |
最終ジャッジ日時 | 2024-09-26 12:38:09 |
合計ジャッジ時間 | 9,028 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | MLE * 1 -- * 24 |
ソースコード
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]))