Children’s Queue Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13333    Accepted Submission(s): 4364 Problem Description There are many students in PHT School. One day, the headmaster whose na…
Children's Queue Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 11117    Accepted Submission(s): 3577 Problem Description There are many students in PHT School. One day, the headmaster whose n…
这道题我已经推出00和1过两步变成00了,可我没有继续做下去-- 后来看了博客发现自己已经做了90%了-- 可惜了,以后不要轻易放弃. 1的个数有个规律,就是每次都乘以2,因为0和1下一步都会变出1 然后因为0和1个个数是一样的,所以1的变出1,0的也变出1 最后1的个数就乘以2了 第i次1的个数为2的(i-1)次方. 最后要用高精度,高精度可以不去弄那些类什么的,直接重数组模拟就好了 可以一位存一万来提高效率. 相加,进位,去零 #include<cstdio> #define REP(i,…
再加上男人:dp[i-1]: 加2一个女人:dp[i-2]+x. 上述的另一种情况下dp[i-2]它不仅包括加2女人对法律状况.和x是一个加号ff原违法的法律案后加入,这最后是mf案例,然后,x=dp[i-4](其次是mfff). 这题要用大数: #include<math.h> #include<stdio.h> #include<stdlib.h> #include<string.h> int main(void) { int n; int dp[100…
题目大意:轮状病毒基定义如图.求有多少n轮状病毒 这个递推实在是不会--所以我选择了打表找规律 首先执行下面程序 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #define M 110 using namespace std; struct abcd{ int to,next; bool ban; }table[M<<2]; int head[…
Children’s Queue Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12101 Accepted Submission(s): 3953 Problem Description There are many students in PHT School. One day, the headmaster whose name is…
Children’s Queue Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 16006    Accepted Submission(s): 5337 Problem Description There are many students in PHT School. One day, the headmaster whose n…
Children’s Queue Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17918    Accepted Submission(s): 5976 Problem Description There are many students in PHT School. One day, the headmaster whose na…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1297 题目大意: 有n个同学, 站成一排, 要求 女生最少是两个站在一起, 问有多少种排列方式. 题目分析: 1.  假设第n个学生是个男生, 我们可以直接将他放在最后有 dp[n-1]种 即: ...............M   dp[n-1] 2.假设第n个放女生,要求两个女生在一起, 我们可以直接在最后放两个女生 即: .............FF    dp[n-2] 3.假设我们后面…
题目链接: http://codeforces.com/problemset/problem/353/D?mobile=true H. Queue time limit per test 1 secondmemory limit per test 256 megabytes 问题描述 There are n schoolchildren, boys and girls, lined up in the school canteen in front of the bun stall. The b…