Rezultati

Up. imeNalogaJezikRezultatČas oddaje
bitikubiti-2017 Hodnik Java 100/100OK 20. apr '17 @ 16:22

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 34,852 MiB 0,000 s OK
#2 10/10 33,938 MiB 0,000 s OK
#3 10/10 36,941 MiB 0,000 s OK
#4 10/10 33,340 MiB 0,000 s OK
#5 10/10 33,566 MiB 0,000 s OK
#6 10/10 33,191 MiB 0,000 s OK
#7 10/10 36,477 MiB 0,000 s OK
#8 10/10 36,793 MiB 0,000 s OK
#9 10/10 36,941 MiB 0,000 s OK
#10 10/10 33,406 MiB 0,000 s OK

Ocenjevani program (C.java):
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by bitikubiti-2017 on 4/20/17.
 */
public class C {
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int a = 0;
        int b = 0;
        for (int i = 0; i < line.length(); i++) {
            if(i%2==0){
                if(line.charAt(i)=='0')a++;
                else b++;
            }
            else{
                if(line.charAt(i)=='0')b++;
                else a++;

            }
        }
        System.out.println(Math.min(a,b));
    }
}