Not easy series of (3)--lele RPG puzzles

Source: Internet
Author: User

Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others) Total Submission (s): 35148 Accepted Submission (s): 14106


problem DescriptionCalled "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?

 
InputThe input data contains multiple test instances, one row per test instance, and an integer n, (0<n<=50).
 
Outputfor each test instance, output all of the required coating methods, one row for each instance output.
 
Sample Input
12
 
Sample Output
36


#include <stdio.h>

int main ()
{
int i,m,a,b;
Double x[52];
x[1]=3;
x[2]=6;
x[3]=6;
for (i=4; i<52; i++)
x[i]=x[i-1]+x[i-2]*2;
while (scanf ("%d", &m)!=eof)
{
printf ("%.lf\n", X[m]);
}
return 0;
}

Not easy series of (3)--lele RPG puzzles

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.