摘要:
程序设计导引及在线实践 第一种解法,直接递归,优化后,改为逆推动态规划 打印路径,可以反过来计算。 #include<iostream> using namespace std; #define MAX_NUM 100 int A[MAX_NUM + 10][MAX_NUM + 10]; int D 阅读全文
摘要:
http://ybt.ssoier.cn:8088/problem_show.php?pid=1190 #include<iostream> using namespace std; const int maxn=71;//课本里面100有误,long long 都会溢出 const int mod 阅读全文
摘要:
http://ybt.ssoier.cn:8088/problem_show.php?pid=1189 把1188的mod和递推公式修改一下即可。 #include<iostream> using namespace std; const int maxn=1000000; const int mo 阅读全文
摘要:
http://ybt.ssoier.cn:8088/problem_show.php?pid=1188 #include<iostream> using namespace std; const int maxn=1000000; const int mod=1000; int f[maxn+1]; 阅读全文
摘要:
http://ybt.ssoier.cn:8088/problem_show.php?pid=1314 #include<iostream> using namespace std; const int maxn=20+5; long long f[maxn][maxn];//数据可能超出int i 阅读全文
摘要:
#include<iostream> using namespace std; const int maxn=100; long long a[maxn], b[maxn];//注意要用long long a[i] 代表第i个月的成虫数量,b[i]代表第i个月的幼虫数量 int main() { i 阅读全文