上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 21 下一页
摘要: #include #include #include using namespace std; const int maxn=100000+10; const int nil=1000000000; struct my{ int next; int v; int w; }; bool vis[maxn][3]; int cnt[maxn][3],d... 阅读全文
posted @ 2018-07-19 20:58 lmjer 阅读(200) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std; struct my{ int v; int next; int w; }; struct head{ int u; int w; bool operatorrhs.w; } }; ... 阅读全文
posted @ 2018-07-19 19:02 lmjer 阅读(215) 评论(0) 推荐(0) 编辑
摘要: int ans[maxn]; bool vis[maxn]; queueq; void spfa(int f){ memset(ans,63,sizeof(ans)); ans[f]=0; vis[f]=true; while(!q.empty()) q.pop(); q.push(f); while(!q.empty()){ ... 阅读全文
posted @ 2018-07-18 19:47 lmjer 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 可以得到这样的关系:奇数加、偶数减 例题一. poj 3904 Sky Code 题目大意 给一串数字,求解互质四元组的个数(注意不必两两互质) 解题思路 网上有很多代码,但是详细讲解的很少,这里结合笔者的思路详细论述一下解题思路,耐心一看。 首先容易想到,想计算不互质的四元组的个数,再用总的减去, 阅读全文
posted @ 2018-07-17 20:41 lmjer 阅读(561) 评论(0) 推荐(0) 编辑
摘要: 4827: 魔法球 Description Freda和rainbow是超自然之界学校(Preternatural Kingdom University,简称PKU)魔法学院的学生。为了展示新学的魔法,Ta们决定进行一场对弈~~~ 起初Freda面前有n堆魔法珠,其中第i堆有ai颗。Freda和ra 阅读全文
posted @ 2018-07-17 10:24 lmjer 阅读(463) 评论(0) 推荐(0) 编辑
摘要: 求有多少种长度为 n 的序列 A,满足以下条件: 1 ~ n 这 n 个数在序列中各出现了一次 若第 i 个数 A[i] 的值为 i,则称 i 是稳定的。序列恰好有 m 个数是稳定的 满足条件的序列可能很多,序列数对 10^9+7 取模。 Input 第一行一个数 T,表示有 T 组数据。 接下来 阅读全文
posted @ 2018-07-16 21:36 lmjer 阅读(311) 评论(0) 推荐(1) 编辑
摘要: 表示并不会做这道题, 阅读全文
posted @ 2018-07-16 17:38 lmjer 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 1、线性基: 若干数的线性基是一组数a1,a2,...an ,其中ax的最高位的1在第x 位。 通过线性基中元素xor 出的数的值域与原来的数xor 出数的值域相同。 2、线性基的构造法: 对每一个数p 从高位到低位扫,扫到第x位为1时,若ax不存在,则ax=p并结束此数的扫描,否则令p=p xor 阅读全文
posted @ 2018-07-16 16:34 lmjer 阅读(212) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; const int mod=7; int n,m; int a[300+10][300+10]; char c1[10],c2[10],c[10][10]={"1","MON","TUE","WED","THU","FRI","SAT","SUN"};//星期几 int get(char p[]... 阅读全文
posted @ 2018-07-16 10:23 lmjer 阅读(318) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std; typedef long long ll; ll power(ll a,ll b,ll mod){ ll ans=1%mod; for (;b;b>>=1){ if(b&1) ans=ans*a%mod; a=a*a%mod; } retu... 阅读全文
posted @ 2018-07-14 17:14 lmjer 阅读(196) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 21 下一页