摘要:
problemsolutioncodes#include #include #include #include using namespace std;const int M=505;int n,la,lb,a[M],b[M],ans=0;int f[M];void ... 阅读全文
posted @ 2018-05-31 21:45
gwj1139177410
阅读(154)
评论(0)
推荐(0)
摘要:
problemsolutioncodes//vijos 1180#include#includeusing namespace std;struct Edge { int w; vectorto; }G[1010];int f[1010][1010];//dfs(x... 阅读全文
posted @ 2018-05-31 21:43
gwj1139177410
阅读(177)
评论(0)
推荐(0)
摘要:
problemsolutioncodes#include#includeusing namespace std;struct side{ int u, v, w; }e[10010];bool cmp(const side &a, const side &b){ re... 阅读全文
posted @ 2018-05-31 21:42
gwj1139177410
阅读(110)
评论(0)
推荐(0)
摘要:
problemsolutioncodes//vijos1790//拓扑排序的本质是本次将入度为0的点排到序列的最前端。#include#include#include#define maxn 100000+10using namespace std;int n, m,... 阅读全文
posted @ 2018-05-31 21:40
gwj1139177410
阅读(166)
评论(0)
推荐(0)
摘要:
problem一条路上有n个教学评估团,对于每个评估团从s开始每d个站一个人直到e结束现在要找到一个站的人数是奇数的点,这个点可能没有,且至多只有一个问这个点在哪以及这个点站了多少人solution因为最多只有一个点是奇数,所以很显然会想到奇数+偶数=奇数,所以说明这... 阅读全文
posted @ 2018-05-31 21:37
gwj1139177410
阅读(165)
评论(0)
推荐(0)
摘要:
problem给定n个人朋友的朋友是朋友,敌人的敌人是朋友朋友之间组成一个团伙,求团伙数solution将每个点x拆成两个:x和x+n(分别表示x的朋友和敌人)如果x和y是朋友,就将x和y合并如果x和y是敌人,就将x和y+n合并,将y和x+n合并注意朋友的敌人不一定是... 阅读全文
posted @ 2018-05-31 15:28
gwj1139177410
阅读(151)
评论(0)
推荐(0)
摘要:
1、二分的基本用法是在单调序列或单调函数中进行查找。 2、当问题的答案具有单调性时,就可以通过二分把求解转化为判定(判定一般比求解容易实现。A基本用法(这里都是个人写法,可以跳过1、整数域1)原则最终答案处于闭区间[l,r]内循环以l==r结束每次二分中间值mid归属... 阅读全文
posted @ 2018-05-31 13:21
gwj1139177410
阅读(157)
评论(0)
推荐(0)
摘要:
problemsolutioncodes#includeusing namespace std;int n, c[20];void dfs(int cur){ if(cur == n){ for(int i = 0; i >n; dfs(0)... 阅读全文
posted @ 2018-05-31 12:56
gwj1139177410
阅读(103)
评论(0)
推荐(0)
摘要:
problemsolutioncodes//c[i]:第i行的皇后放在第几列#includeusing namespace std;int n, c[20], ans;void dfs(int cur){ if(cur > n)ans++; else fo... 阅读全文
posted @ 2018-05-31 12:55
gwj1139177410
阅读(119)
评论(0)
推荐(0)

浙公网安备 33010602011771号