摘要: bool spfa(){ queueque; que.push(s); memset(dis,INF,sizeof(dis)); dis[s]=0; while(!que.empty()){ int u=que.front(); que.pop(); vis[u]=0; for(int i=head[u];~i;i=edge[i].nextt){ int v=ed... 阅读全文
posted @ 2019-05-19 23:48 starve_to_death 阅读(129) 评论(0) 推荐(0) 编辑
摘要: bool bfs(){ memset(deep,0,sizeof(deep)); queueque; que.push(s); deep[s]=1; while(!que.empty()){ int u=que.front(); que.pop(); for(int i=head[u];i!=-1;i=e[i].nextt){ int v=e[i].v; if(... 阅读全文
posted @ 2019-05-19 23:46 starve_to_death 阅读(124) 评论(0) 推荐(0) 编辑
摘要: https://acm.ecnu.edu.cn/contest/173/problem/E/ 区间操作,线段树; 维护乘的次数和除的次数 最后答案是,div和mul共同作用的结果, 分两种来考虑,第一种是当前有足够多次1操作,所以当再来一次操作时,直接在此基础上进行修改,除就减,乘就加; 第二种比较 阅读全文
posted @ 2019-05-19 01:58 starve_to_death 阅读(146) 评论(0) 推荐(0) 编辑