摘要: DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calcul... 阅读全文
posted @ 2015-07-26 19:21 lee是美少女 阅读(133) 评论(0) 推荐(0) 编辑
摘要: #include#includeusing namespace std;int n,a[1006];int main(){ int t,i; cin>>t; while(t--) { int f=0; //每次f归0 cin>>n; ... 阅读全文
posted @ 2015-07-26 19:19 lee是美少女 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Time Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uDescriptionTwo bored soldiers are playing card war. Their card deck consists of exa... 阅读全文
posted @ 2015-07-26 19:14 lee是美少女 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束... 阅读全文
posted @ 2015-07-26 19:07 lee是美少女 阅读(885) 评论(0) 推荐(0) 编辑