結果

問題 No.2076 Concon Substrings (ConVersion)
ユーザー 👑 p-adicp-adic
提出日時 2023-06-11 17:42:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 318 bytes
コンパイル時間 671 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 87,252 KB
最終ジャッジ日時 2023-08-31 01:59:26
合計ジャッジ時間 17,565 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 72 ms
71,156 KB
testcase_02 AC 69 ms
71,436 KB
testcase_03 AC 71 ms
71,592 KB
testcase_04 WA -
testcase_05 AC 719 ms
77,788 KB
testcase_06 RE -
testcase_07 AC 2,602 ms
87,252 KB
testcase_08 AC 1,739 ms
82,580 KB
testcase_09 AC 2,664 ms
86,688 KB
testcase_10 AC 72 ms
71,316 KB
testcase_11 AC 71 ms
71,504 KB
testcase_12 AC 74 ms
71,160 KB
testcase_13 WA -
testcase_14 AC 71 ms
71,332 KB
testcase_15 AC 1,199 ms
78,096 KB
testcase_16 AC 608 ms
78,768 KB
testcase_17 AC 332 ms
78,380 KB
testcase_18 AC 1,849 ms
80,292 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 RE -
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
76,036 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
	elif c//3:X,c=X+[c//3],0
D=[0]+[-1]*N
L=0
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