Rezultati

Up. imeNalogaJezikRezultatČas oddaje
kira Hodnik C++ 100/100OK 20. apr '17 @ 16:30

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 3,055 MiB 0,004 s OK
#2 10/10 3,055 MiB 0,004 s OK
#3 10/10 3,059 MiB 0,004 s OK
#4 10/10 3,055 MiB 0,004 s OK
#5 10/10 3,059 MiB 0,004 s OK
#6 10/10 3,105 MiB 0,004 s OK
#7 10/10 3,113 MiB 0,004 s OK
#8 10/10 3,117 MiB 0,004 s OK
#9 10/10 3,117 MiB 0,004 s OK
#10 10/10 3,121 MiB 0,004 s OK

Ocenjevani program (Hallway.cpp):
//============================================================================
// Name        : Hallway.cpp
// Author      : Kira
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

// radical 129 ////////////////////////////////////////////
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <string>
#include <stack>
#include <deque>
#include <cstdlib>
#include <map>
#include <cmath>
#include <string.h>
#define pii pair<int,int>
#define pib pair<int,bool>
#define mp make_pair
#define pb push_back
#define FOR(i,n) for(int i=0,_n=n;i<_n;i++)
#define FORR(i,j,n) for(int i=j,_n=n;i<_n;i++)
using namespace std;
typedef long long ll;
// radical 159 ////////////////////////////////////////////

char opt1[1000];
char opt2[1000];

int main() {
	string input;
	cin >> input;
	int SIZE = input.length();
	FOR(i,SIZE)
	{
		//set opt1 and opt2
		if(i%2==0){opt1[i]='0'; opt2[i]='1';}
		else{opt1[i]='1'; opt2[i]='0';}
	}

	int counter1=0;
	int counter2=0;
	FOR(i,SIZE)
	{
		if(input[i]!=opt1[i]){counter1++;}
		if(input[i]!=opt2[i]){counter2++;}
	}
	cout << min(counter1,counter2) << endl;
	return 0;
}