CF1165A.Remainder

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given a huge decimal number consisting of nn digits. It is guaranteed that this number has no leading zeros. Each digit of this number is either 0 or 1.

You may perform several (possibly zero) operations with this number. During each operation you are allowed to change any digit of your number; you may change 0 to 1 or 1 to 0. It is possible that after some operation you can obtain a number with leading zeroes, but it does not matter for this problem.

You are also given two integers 0y<x<n0 \le y < x < n . Your task is to calculate the minimum number of operations you should perform to obtain the number that has remainder 10y10^y modulo 10x10^x . In other words, the obtained number should have remainder 10y10^y when divided by 10x10^x .

输入格式

The first line of the input contains three integers n,x,yn, x, y ( 0y<x<n21050 \le y < x < n \le 2 \cdot 10^5 ) — the length of the number and the integers xx and yy , respectively.

The second line of the input contains one decimal number consisting of nn digits, each digit of this number is either 0 or 1. It is guaranteed that the first digit of the number is 1.

输出格式

Print one integer — the minimum number of operations you should perform to obtain the number having remainder 10y10^y modulo 10x10^x . In other words, the obtained number should have remainder 10y10^y when divided by 10x10^x .

输入输出样例

  • 输入#1

    11 5 2
    11010100101
    

    输出#1

    1
    
  • 输入#2

    11 5 1
    11010100101
    

    输出#2

    3
    

说明/提示

In the first example the number will be 1101010010011010100100 after performing one operation. It has remainder 100100 modulo 100000100000 .

In the second example the number will be 1101010001011010100010 after performing three operations. It has remainder 1010 modulo 100000100000 .

首页