上一页 1 2 3 4 5 6 ··· 45 下一页
摘要: #include <cstdio> #include <algorithm> using namespace std; int n,a[5010],f[5010],t[5010],maxn=1,ans; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++ 阅读全文
posted @ 2020-07-24 16:50 wqtnb_tql_qwq_%%% 阅读(119) 评论(0) 推荐(0) 编辑
摘要: //第二类斯特林数//第二类斯特林数适用于解决球不同,盒子相同,不能有空盒的情况 //我们设f[i][j]表示i个球到j个盒子的方案数//边界:f[0][0]=1//转移:f[i][j]=f[i-1][j]*j+f[i-1][j-1] #include <stdio.h> #include <std 阅读全文
posted @ 2020-07-24 13:29 wqtnb_tql_qwq_%%% 阅读(112) 评论(0) 推荐(0) 编辑
摘要: #include <cstdio> using namespace std; int n,a[500010],ans; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++)scanf("%d",&a[i]); ans=a[1]; for(int i=2; 阅读全文
posted @ 2020-07-22 20:26 wqtnb_tql_qwq_%%% 阅读(101) 评论(0) 推荐(0) 编辑
摘要: #include <cstdio> #include <cstring> using namespace std; int SG[1010],f[1010],cnt; bool S[1010]; void get_SG(){ for(int i=1;i<=1000;i++){ memset(S,0, 阅读全文
posted @ 2020-07-22 19:44 wqtnb_tql_qwq_%%% 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Matches Game Description Here is a simple game. In this game, there are several piles of matches and two players. The two player play in turn. In each 阅读全文
posted @ 2020-07-22 16:49 wqtnb_tql_qwq_%%% 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 取石子游戏 Description 有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好 阅读全文
posted @ 2020-07-22 16:03 wqtnb_tql_qwq_%%% 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Problem Description 对于四川同胞遭受的灾难,全国人民纷纷伸出援助之手,几乎每个省市都派出了大量的救援人员,这其中包括抢险救灾的武警部队,治疗和防疫的医护人员,以及进行心理疏导的心理学专家。根据要求,我校也有一个奔赴灾区救灾的名额,由于广大师生报名踊跃,学校不得不进行选拔来决定最后 阅读全文
posted @ 2020-07-22 15:45 wqtnb_tql_qwq_%%% 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 两种dp方式 第一种dp[i][j]表示到第i个节点花费j的时间能偷到的最多的画 #include <cstdio> #include <algorithm> using namespace std; int s,a[210],d[210],f[210][6010]; void make_tree( 阅读全文
posted @ 2020-07-17 14:56 wqtnb_tql_qwq_%%% 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Description Sample Input 31 3 31 1 11 2 3 Sample Output 4 用生命在dp啊啊啊 考虑dp[i][j][k] i表示当前选择了i个数 j表示以j列结尾 k为二进制表示当前有那些行在里面比如001表示第一行010表示第二行100表示第三行110表示 阅读全文
posted @ 2020-07-16 20:03 wqtnb_tql_qwq_%%% 阅读(225) 评论(0) 推荐(1) 编辑
摘要: #include <cstdio> #include <cstring> #include <algorithm> #include <stack> #include <vector> #include <cmath> using namespace std; #define ll long lon 阅读全文
posted @ 2020-07-15 16:24 wqtnb_tql_qwq_%%% 阅读(87) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 45 下一页