Problem:
Start with a long, can not fit, immediately want to use a large number to do.
Do not use a large number in a long load, you can try double,double to meet most requirements
Not easy series of (3)--lele RPG puzzlesTime
limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total submission (s): 35395 Accepted Submission (s): 14209
Problem description called "AC female killer" Super Idol Lele recently suddenly played a deep, this can be nasty a lot of "Cole" (Lele fans, that is, "Cola"), after the multi-snooping, a veteran Cole finally know the reason, the original, 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 data contains multiple test instances, one row per test instance, and an integer n, (0<n<=50).
Output for each test instance, export all of the required coating methods, one row for each instance output.
Sample Input
12
Sample Output
36
Code:
</pre><pre name= "code" class= "java" >import java.util.*;p ublic class main{public static void Main (string[] args) {Scanner cin=new Scanner (system.in);d ouble a[]=new double[55];for (int i=5;i<54;i++) {a[1]=3;a[2]=6;a[3]=6;a[ 4]=18;a[i]=a[i-1]+a[i-2]*2;} int N;while (Cin.hasnext ()) {n=cin.nextint (); System.out.printf ("%.0f\r\n", A[n]);}}}
HDU 2045 Not Easy Series (3)--lele RPG puzzle (Java)