結果

問題 No.2076 Concon Substrings (ConVersion)
ユーザー 👑 p-adicp-adic
提出日時 2023-06-11 19:16:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 288 bytes
コンパイル時間 561 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 258,580 KB
最終ジャッジ日時 2023-08-31 02:02:30
合計ジャッジ時間 17,296 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
71,644 KB
testcase_01 WA -
testcase_02 AC 60 ms
71,300 KB
testcase_03 AC 62 ms
71,404 KB
testcase_04 AC 61 ms
71,424 KB
testcase_05 AC 662 ms
77,664 KB
testcase_06 AC 65 ms
76,752 KB
testcase_07 AC 1,815 ms
87,160 KB
testcase_08 AC 2,129 ms
258,580 KB
testcase_09 AC 2,110 ms
87,248 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 58 ms
71,396 KB
testcase_14 AC 57 ms
71,536 KB
testcase_15 AC 729 ms
78,232 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 184 ms
78,692 KB
testcase_20 WA -
testcase_21 AC 72 ms
71,384 KB
testcase_22 WA -
testcase_23 AC 107 ms
77,580 KB
testcase_24 AC 106 ms
77,892 KB
testcase_25 AC 109 ms
77,952 KB
testcase_26 AC 120 ms
77,724 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 141 ms
78,444 KB
testcase_31 AC 79 ms
75,888 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],s=="c"
D=[0]+[-N]*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],(x-A*j)//B+D[i-j])
print(max([i+min(i,D[i])for i in R(L)]))
0