Friends
Description
Mike is so skillful that he can master $n$ languages (aka. programming languages).
His nine friends are all weaker than he. The sets they can master are all subsets of Mike's languages.
But the relations between the nine friends is very complex. Here are some clues.
1. Alice is a nice girl, so her subset is a superset of Bob's.
2. Bob is a naughty boy, so his subset is a superset of Carol's.
3. Dave is a handsome boy, so his subset is a superset of Eve's.
4. Eve is an evil girl, so her subset is a superset of Frank's.
5. Gloria is a cute girl, so her subset is a superset of Henry's.
6. Henry is a tall boy, so his subset is a superset of Irene's.
7. Alice is a nice girl, so her subset is a superset of Eve's.
8. Eve is an evil girl, so her subset is a superset of Carol's.
9. Dave is a handsome boy, so his subset is a superset of Gloria's.
10. Gloria is a cute girl, so her subset is a superset of Frank's.
11. Gloria is a cute girl, so her subset is a superset of Bob's.
Now Mike wants to know, how many situations there might be.
Input
For each test case, the first line contains an integer $n$($0\leq n\leq 3000$), denoting the number of languages.
Output
Sample Input
0
2
Sample Output
import java.math.BigInteger;
import java.util.Scanner;
public class Main{ public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int t=in.nextInt();
int cased=;
while(t-->){
int n=in.nextInt();
BigInteger b=new BigInteger("");
System.out.println("Case #"+cased+": "+b.pow(n).toString());
cased++;
}
}
}
随机推荐
- 错误处理try catch
<?phpfunction inverse($x) { if (!$x) { throw new Exception('被除数不能为0'); } if ($x>31) { throw ne ...
- mysql 从5.1升级到5.5.33 后 innodb 表出错 及 innodb表修复
服务器使用的是mysql 5.1,了解到 5.5 系列的版本 innodb 的性能有很大提升,就想升级下.按照查到的步骤: http://www.myhack58.com/Article/sort09 ...
- java里,当long与上了int
long switchState = 0xf0000000000L; int result = (switchState & 0xff00000000L) > 0 ? 0x01 : 0x ...
- Ubuntu 12.04 (10) Personal Environment - @staticor
Chinese Input ================= I use Wubu, so Fcitx, sudo add-apt-repository ppa:fcitx-team/nightly ...
- java高级project师须要掌握的技术
1.你须要精通面向对象分析与设计(OOA/OOD).涉及模式(GOF,J2EEDP)以及综合模式.你应该十分了解UML,尤其是class,object,interaction以及statediagra ...
- 跨平台运行ASP.NET Core 1.0(转载)
前言 首先提一下微软更名后的叫法: ASP.NET 5 更名为 ASP.NET Core 1.0 .NET Core 更名为 .NET Core 1.0 Entity Framework 7 更名为 ...
- pyfits例子
下面是一个读入fits文件,画积分强度图,再把某个星表里的天体画到图上的python程序. ====================================================== ...
- malloc & free
动态分配内存 #include<stdio.h> #include<stdlib.h> int compare_integers(void const *a,void cons ...
- SuperSocket源码解析之消息处理
一 简述 Tcp消息的处理本身是与Tcp消息传输过程独立的,是消息的两个不同阶段,从前面的会话生命周期我们已经知道消息的传输主要有SocketSession实现,而真正处理则交由AppSession实 ...
- SignalR系列教程:在MVC5中使用SignalR
本章主要内容: 1:向MVC5添加SignaIr 2: 什么是集线器,如何创建集线器 3: 客户端通过jqery调用集线器 本文还是延续“SignaIR快速入门”中聊天室的例子进行讲解.首先我们通过V ...