上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 31 下一页
摘要: /*每个环 要么不选 要么全选 可缩点 就得到一个GAD图 然后搞搞算出最大路径*/ #include #include #include #define maxn 100010 using namespace std; int T,n,m,num,head[maxn],low[maxn],dfn[maxn],s[maxn],top,vi[maxn]; int sum,belong[maxn],... 阅读全文
posted @ 2016-08-24 09:16 一入OI深似海 阅读(235) 评论(0) 推荐(0) 编辑
摘要: /*哈哈我Tarjan套lca.. 丫输出case啥的没看见...*/ #include #include #include #define maxn 300010 using namespace std; int n,m,num,head[maxn],low[maxn],dfn[maxn],topt; int s[maxn],top,f[maxn],sum,belong[maxn],cnt,c... 阅读全文
posted @ 2016-08-24 06:48 一入OI深似海 阅读(137) 评论(0) 推荐(0) 编辑
摘要: /*重边不能删 不能删 不能删...*/ #include #include #include #define maxn 10010 using namespace std; int n,m,num,head[maxn],low[maxn],dfn[maxn],topt; int top,s[maxn],f[maxn],ans,sum,belong[maxn],r[maxn]; struct n... 阅读全文
posted @ 2016-08-24 06:28 一入OI深似海 阅读(312) 评论(0) 推荐(0) 编辑
摘要: /*set加速维护*/ #include #include #include #include #define maxn 100010 using namespace std; sets; set::iterator p; int n,m,a[maxn],top; char c[10]; int init() { int x=0,f=1;char s=getchar(); whi... 阅读全文
posted @ 2016-08-22 21:05 一入OI深似海 阅读(301) 评论(0) 推荐(0) 编辑
摘要: /*双向bfs (得分和单项的一样多....)70*/ #include #include #include #include #define maxn 35 #define maxm 810010 using namespace std; int n,m,q,g[maxn][maxn]; int X,Y,sx,sy,ex,ey,falg,vis[maxn][maxn]; int xx[4]={... 阅读全文
posted @ 2016-08-22 21:02 一入OI深似海 阅读(274) 评论(0) 推荐(0) 编辑
摘要: /* 我是不会说我考试的时候想到了正解却把金币取大看成金币求和的.... 觉得只按左右手乘积排序不太对 有反例 也可能我反例放到这个题里是错的吧 按自己的理解排的序 就是各种讨论... 假设 第i个人是x1 y1 第i+1个人是x2 y2 前面所有的左手乘积为S 我们通过考虑这两个人决定排序的规则 答案就是 min(max(S/y1,S*x1/y2),max(S/y2,S*x2/y1)) 拿掉... 阅读全文
posted @ 2016-08-18 17:59 一入OI深似海 阅读(323) 评论(0) 推荐(0) 编辑
摘要: /* 状态定义的没错 就是考试的时候傻啦吧唧的转移左右孩子 其实之转移父亲就简单多了 不用考虑那么多 还有就是偷懒没有把谁有没有找过这个信息转过去 而是搞了个全局变量…wa到挺 再就是特盘的时候还有终止条件写的不好 写的时间也很长 ….. */ #include #include #include #define maxn 510 #define inf 0x3f3f3f3f using nam... 阅读全文
posted @ 2016-08-17 20:11 一入OI深似海 阅读(167) 评论(0) 推荐(0) 编辑
摘要: /*机智sort二维转一维*/ #include #include #include #include #define maxn 50010 using namespace std; int n,s,num,c[maxn*6]; struct node { int l,r; }a[maxn*6]; int cmp(const node &x,const node &y) { if... 阅读全文
posted @ 2016-08-17 20:09 一入OI深似海 阅读(173) 评论(0) 推荐(0) 编辑
摘要: /* 表示很遗憾.. 开始状态想的没错 就是转移的时候出了问题 自己也想到了数组平移 然而没往下写 与正解擦肩而过…. 然后为了好转移写了个4维的 时间不多了没来得及降维 草草的算算空间就交了… 尼玛double忘记*8了 华丽的直接Memory limit exceeded while compiling 我尼玛0分 考试后写了写用原来的状态写了写数组平移然后降维 数据太水就A了 */ #i... 阅读全文
posted @ 2016-08-17 19:58 一入OI深似海 阅读(150) 评论(2) 推荐(0) 编辑
摘要: 这题之前做过…先听后做的 所以直接打了优化的dp、 然而不是自己想的方法还是理解的不好 一直75分 wa到挺 今天考试看到暴力dp70分 很自信加上点 continue break啥的就80+了 比优化的dp得分多 机智的我哈哈哈….. 然而手残了..枚举k次蹦跶结果转移的时候我特么都是+1不是+k 悲伤的我眼泪掉下来….. 然后改过来就80了 又不好办了.. 下面是80分代码 #include... 阅读全文
posted @ 2016-08-17 19:57 一入OI深似海 阅读(298) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 31 下一页