摘要: Problem CMonkeys inthe Emei MountainInput: Standard InputOutput: Standard Output Xuexue is a prettymonkey living in the Emei mountain.She is extremely thirsty during time 2 and time 9 everyday, so she must drink 2units water during this period. She may drink water more than once, as long asthe total 阅读全文
posted @ 2013-10-06 23:30 Ramanujan 阅读(647) 评论(0) 推荐(0) 编辑
摘要: Dinic:int vis[MAXN], d[MAXN];bool bfs(cint s, cint t){ queue q; q.push(s); memset(vis, 0, sizeof(vis)); d[s]=0; vis[s]=1; while(!q.empty()){ int u=q.front(); q.pop(); for(int i=h[u]; i!=-1; i=e[i].nxt){ int v=e[i].v, cap=e[i].cap, ef=e[i].flow; ... 阅读全文
posted @ 2013-10-06 22:58 Ramanujan 阅读(309) 评论(0) 推荐(0) 编辑