結果
問題 | No.2076 Concon Substrings (ConVersion) |
ユーザー | 👑 p-adic |
提出日時 | 2023-06-11 17:14:43 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 293 bytes |
コンパイル時間 | 513 ms |
コンパイル使用メモリ | 87,152 KB |
実行使用メモリ | 157,028 KB |
最終ジャッジ日時 | 2023-08-31 01:58:44 |
合計ジャッジ時間 | 11,507 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 75 ms
157,028 KB |
testcase_01 | AC | 73 ms
70,880 KB |
testcase_02 | AC | 75 ms
71,080 KB |
testcase_03 | AC | 72 ms
71,168 KB |
testcase_04 | AC | 74 ms
71,040 KB |
testcase_05 | AC | 3,669 ms
79,236 KB |
testcase_06 | AC | 100 ms
78,108 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 | -- | - |
ソースコード
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 for x in X: for i in R(N,-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(N)]))