题目链接: 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…
任意门:https://nanti.jisuanke.com/t/31453 A.Hard to prepare After Incident, a feast is usually held in Hakurei Shrine. This time Reimu asked Kokoro to deliver a Nogaku show during the feast. To enjoy the show, every audience has to wear a Nogaku mask, a…
题目链接:https://cn.vjudge.net/problem/HDU-2045 找规律 代码 #include <cstdio> long long num[51][2]; int n; int main(void){ num[0][0]=2; num[0][1]=0; for (int i=0; i<50; i++){ num[i+1][0]+=num[i][0]+num[i][1]*2; num[i+1][1]+=num[i][0]; } while (scanf("…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1165 果断不擅长找规律啊,做这种题静不下心来. Ackermann function can be defined recursively as follows: 递推如上图, 0<m<=3,0<=n<=1000000,,当m==3时,n>=0&&n<=24. 首先发现a(0,i)=i+1; 另外n==0时,a(1,0)=a(0,1)=2; 当m==1,n>…
递推 1什么是递推?:根据已有节点的值,以及规律推出之后节点的值 2为什么要用递推:简单的解决有规矩事件 3怎么用?: 我们举个经典的例子: 如果1对兔子每月能生1对小兔子,而每对小兔在它出生后的第3个月就可以生1对小兔子,如果从1对初生的小兔子开始,1年后能繁殖多少兔子? def my1(max): a ,b,c ,i= 1,0,0 0 while i<max: c = c+b b = a a = c print a+b+c i+=1 方法:我们可以把兔子分为1个月大的,2个月大的,3个月大的…