結果

問題 No.2076 Concon Substrings (ConVersion)
ユーザー 👑 p-adicp-adic
提出日時 2023-06-11 17:51:16
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 306 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 78,112 KB
最終ジャッジ日時 2023-08-31 02:00:09
合計ジャッジ時間 8,359 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,252 KB
testcase_01 AC 69 ms
71,164 KB
testcase_02 AC 68 ms
71,216 KB
testcase_03 AC 70 ms
71,168 KB
testcase_04 AC 68 ms
71,376 KB
testcase_05 AC 787 ms
78,112 KB
testcase_06 AC 74 ms
76,508 KB
testcase_07 TLE -
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 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

I,R=input,range
N,A,B=map(int,I().split())
S=I()+'0'
X=[]
c=0
w="con"
for s in S:
	if s==w[c%3]:c+=1
	else:X,c=X+[c//3],0
D=[0]+[-1]*N
L=1
for x in X:
	L+=x//A
	for i in R(L,-1,-1):D[i]=max([[-1,(x-A*j)//B+D[i-j]][D[i-j]>=0]for j in R(min(x//A,i)+1)])
print(max([[0,i+min(i,D[i])][D[i]>i-2]for i in R(L)]))
0