Cod sursa(job #28131)

Utilizator ProstuStefan-Alexandru Filip Prostu Data 7 martie 2007 15:15:59
Problema A+B Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.86 kb
#include <iostream>
#include <fstream>
#include <string>
#include <cstdio>
#include <cmath>
#include <vector>
#include <deque>

using namespace std;

bool prim(int x) {
	if ((x & 1) == 0)
		if (x == 2) 
			return true;
		else
			return false;
	else {
		int d, stop = (int) sqrt((double) x);
		for (d = 3; d <= stop; d += 2)
			if (x % d == 0)
				return false;
	}

	return true;
}

int question ()
{
int a=1,b=-1;

a= ( (--a) && (b++) );
a++;
b= ( b || (a--) );

cout<<"("<<a<<","<<b<<")";
return 1;
}

const int NMAX = 1 << 17;

int A[NMAX];

void ceva(int k) {
	int i, j;

	for (i = 1, j = k; i < j; i <<= 1, j >>= 1);

	A[k] = i;

	if (k + 1 < NMAX)
		ceva(k + 1);

	A[k] = j;
//	printf("%d\n", k);
}

int main() {
	freopen("adunare.in", "rt", stdin);
	freopen("adunare.out", "wt", stdout);

	int a, b;

	scanf(" %d %d", &a, &b);

	ceva(1);

	printf("%d\n", a + b);

	return 0;
}