Exemple #1
0
int recur1(int n) {
	if (n == 0) {
		return 0;
	}
	if (n == 1) {
		return 1;
	}

	int &ret1 = arr[n][1];
	if (ret1 != -1) {
		return ret1;
	}

	
	ret1= recur1(n - 1) + recur1(n - 2);
	return ret1;
}
Exemple #2
0
void recur1(const cubepos&cp,int togo,int canonstate,vector<cubepos> &a){
a.push_back(cp);
if(togo--){
cubepos cp2;
int mask= cubepos::cs_mask(canonstate);
for(int mv= 0;mv<NMOVES;mv++){
if((mask>>mv)&1){
cp2= cp;
cp2.move(mv);
recur1(cp2,togo,cubepos::next_cs(canonstate,mv),a);
}
}
}
Exemple #3
0
int main() {
	int n;
	int num;
	scanf("%d", &n);
	
	for (int i = 0; i < n; i++) {

		scanf("%d", &num);

		for (int k = 0; k < 101; k++) {
			for (int j = 0; j < 2; j++) {
				arr[k][j] = -1;
			}
		}

	
		printf("%d %d\n", recur(num), recur1(num));
	}


}