Not easy series of (3)--lele RPG puzzles
Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others) total submission (s): 15018 Accepted Submission (s): 5938
Problem Description
Called "AC female killer" Super Idol Lele recently suddenly played a deep, this can be nasty many "Cole" (Lele fans, that is, "Cola"), after a lot of snooping, a veteran Cole finally know the reason, originally, Lele recently studied the famous RPG puzzle:
There are rows of n squares, with red (red), powder (Pink), Green (green) Three colors each lattice, each color, requires that any adjacent squares can not be the same color, and the first and the first two squares also different colors. All the requirements of the coating method.
These are the famous RPG puzzles.
If you are Cole, I think you will be able to help Lele solve the problem, if not, look at the many beautiful pain of the Cole Girl's face, you will not stand by?
Input
The input data contains multiple test instances, one row per test instance, and an integer n, (0<n<=50).
Output
For each test instance, output all of the required coating methods, one row for each instance output.
Sample Input
12
Sample Output
Approx. Author
Lcy
According to the previous items, the introduction starts from the fourth, for a "i-1" +2*a "I-2", the note number is greater than the int type, so a long long.
#include <stdio.h>intMain () {Long Longn,x[ -]={3,6,6},i; while(SCANF ("%lld", &n)! =EOF) { for(i=3; i<n;i++) X[i]=x[i-1]+2*x[i-2]; printf ("%lld\n", x[n-1]); } return 0;}
Not easy series of (3)--lele RPG puzzles