上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页
摘要: 这是一道典型的利用状态压缩DP求最优Hamilton回路的题目。取dp[state][i][j]表示state状态下倒数第二个岛为i,最后一个岛为j时的最优解,num[state][i][j]为相应的路径数目,其中state的二进制表示的i位为1表示岛i被访问过,反之为0。则显然当有边(i,j)存在 阅读全文
posted @ 2018-04-15 12:33 lmjer 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 1.a^b可以写成 a*a*a*a....a(b个a相乘) 而b又可以二进制分解为 b=c*2^k-1+c*2^k-2.....+c*2^0(c为该数在二进制下对应数字) 所以 用b>>1可以舍去b的最低位,而b&1可以求出b的最低位 所以 2.64位整数乘法 求a*b%p 阅读全文
posted @ 2018-04-15 10:54 lmjer 阅读(107) 评论(0) 推荐(0) 编辑
摘要: int compress(int *x1,int *x2,int w){ vector xs; for(int i=0;i<N;i++){ for(int d=-1;d<=1;d++){ int tx1=x1[i]+d,tx2=x2[i]+d; if(1<=tx1&&tx1<=w) xs.push_back(tx1); if(... 阅读全文
posted @ 2018-04-12 18:17 lmjer 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 题目限制 时间限制 内存限制 评测方式 题目来源 1000ms 131072KiB 标准比较器 Local 题目描述 学校实行学分制。每门的必修课都有固定的学分,同时还必须获得相应的选修课程学分。学校开设了N(N<300)门的选修课程,每个学生可选课程的数量M是给定的。学生选修了这M门课并考核通过就 阅读全文
posted @ 2018-04-08 19:16 lmjer 阅读(165) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio> #include<algorithm> #include<cstring> using namespace std; long long dp[12][1<<11]; bool ins[1<<11]; int main(){ int n,m; while(scanf 阅读全文
posted @ 2018-04-06 12:45 lmjer 阅读(125) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; const int maxn=11000; struct my{ int next; int v; }; bool biao[110][110]; bool vis[maxn]; int match[maxn]; int n,m,adj[maxn],fa; my bian[... 阅读全文
posted @ 2018-04-05 22:16 lmjer 阅读(299) 评论(0) 推荐(0) 编辑
摘要: Network Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 5665 Accepted: 1602 Description Yixght is a manager of the company called SzqNetwor 阅读全文
posted @ 2018-04-04 22:00 lmjer 阅读(112) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include using namespace std; struct my{ int next; int v; }; const int maxn=10000; int adj[maxn],low[maxn],dfsn[maxn],dfn,fa,id[maxn],sadj[maxn],sfa; my bi... 阅读全文
posted @ 2018-04-02 19:48 lmjer 阅读(405) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; struct my{ int next; int v; }; const int maxn=10000; int low[maxn],dfsn[maxn],adj[maxn],fa,sfa,dfn; int bs[maxn],cnt; bool bridge[maxn*2]; in... 阅读全文
posted @ 2018-04-01 19:26 lmjer 阅读(434) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; typedef long long ll; struct my{ int next; int v; }; const int maxn=100000+10; ll low[maxn],dfsn[maxn],size_[maxn],adj[maxn],fa,dfn,root,ans[ma... 阅读全文
posted @ 2018-03-30 20:11 lmjer 阅读(158) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页