#P1147. T恤衫
T恤衫
题目描述
给定一个 天的日程表 ,现在你有 件普通T恤衫。
对于日程表的每一天 :
· 若 为 0,则这一天你可以洗掉所有的T恤衫。
· 若 为 1, 则这一天你需要穿一件普通T恤 或者 一件有标志的T恤衫。
· 若 为 2,则这一天你需要穿一件有标志的T恤衫。
T恤衫在被洗过之前只能穿一次。
请你求出至少需要再准备几件有标志的T恤衫。
输入输出格式
输入
The input is given from Standard Input in the following format:
N M
S
输出
Print the minimum number of T-shirts Takahashi needs to buy to be able to satisfy the conditions in the problem statement.
If he does not need to buy new T-shirts, print .
样例数据
6 1
112022
2
3 1
222
3
2 1
01
0
相关
在下列比赛中: