結果

問題 No.2076 Concon Substrings (ConVersion)
ユーザー 👑 p-adicp-adic
提出日時 2023-06-11 17:54:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 319 bytes
コンパイル時間 1,133 ms
コンパイル使用メモリ 87,308 KB
実行使用メモリ 86,716 KB
最終ジャッジ日時 2023-08-31 02:00:50
合計ジャッジ時間 16,363 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,084 KB
testcase_01 AC 75 ms
71,160 KB
testcase_02 AC 71 ms
71,096 KB
testcase_03 AC 71 ms
71,088 KB
testcase_04 AC 70 ms
71,392 KB
testcase_05 AC 742 ms
77,584 KB
testcase_06 AC 75 ms
76,380 KB
testcase_07 AC 2,397 ms
86,716 KB
testcase_08 AC 1,615 ms
83,512 KB
testcase_09 AC 2,397 ms
86,716 KB
testcase_10 AC 72 ms
71,340 KB
testcase_11 AC 71 ms
71,136 KB
testcase_12 AC 72 ms
70,948 KB
testcase_13 AC 71 ms
71,452 KB
testcase_14 AC 72 ms
71,284 KB
testcase_15 AC 1,196 ms
78,116 KB
testcase_16 AC 539 ms
78,400 KB
testcase_17 AC 331 ms
78,072 KB
testcase_18 AC 1,653 ms
80,024 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 70 ms
71,188 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 77 ms
75,748 KB
権限があれば一括ダウンロードができます

ソースコード

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]*(c>2),0
D=[0]+[-1]*N
L=1
for x in X:
	L+=x//A
	for i in R(L,-1,-1):
		for j in R(min(x//A,i)+1):D[i]=max(D[i],[-1,(x-A*j)//B+D[i-j]][D[i-j]>=0])
print(max([[0,i+min(i,D[i])][D[i]>i-2]for i in R(L)]))
0