摘要: 题意:求桥思路:求桥的条件是:(u,v)是父子边时 low[v]>dfn[u] 所以我们要解决的问题是怎么判断u,v是父子边(也叫树枝边)。我们在进行dfs的时候,要加入一个fa表示当前进行搜索的点的父节点。v=edge[v].v,如果dfn[v]==0即没访问过,那... 阅读全文
posted @ 2018-04-23 11:50 KirinSB 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 题目:牛客题目链接思路:这道题有点像这道题先缩点,缩完之后判断一下整个强连通分量入度是不是0,如果是的话向ans压入该强连通分量最小的那个值。最后排序一下ans输出就行了。思路一下就想到了,就是写的有点迷,WA了好几发,加点注释...炜神tql...果然我还是菜鸡,水... 阅读全文
posted @ 2018-04-20 22:27 KirinSB 阅读(130) 评论(0) 推荐(0) 编辑
摘要: DescriptionA Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered b... 阅读全文
posted @ 2018-04-19 23:13 KirinSB 阅读(583) 评论(0) 推荐(0) 编辑
摘要: ACM Computer FactoryTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8944 Accepted: 3267 Special JudgeDescriptionAs you know,... 阅读全文
posted @ 2018-04-17 22:18 KirinSB 阅读(217) 评论(0) 推荐(0) 编辑
摘要: The Farey Sequence Fn for any integer n with n >= 2 is the set of irreducible rational numbers a/b with 0 #include#include#include#inc... 阅读全文
posted @ 2018-04-09 11:55 KirinSB 阅读(164) 评论(0) 推荐(0) 编辑
摘要: There is an equation ax + by + c = 0. Given a,b,c,x1,x2,y1,y2 you must determine, how many integer roots of this equation are satisfy ... 阅读全文
posted @ 2018-04-07 23:12 KirinSB 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Given the N integers, you have to find the maximum GCD (greatest common divisor) of every possiblepair of these integers.InputThe firs... 阅读全文
posted @ 2018-04-07 15:02 KirinSB 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 思路:除去前导0,注意两个1不能相邻(11->100),注意 0 *** 或者*** 0或者0 0情况用string的reverse()很舒服代码:#include#include#include#include#include#include#include#inc... 阅读全文
posted @ 2018-04-06 17:23 KirinSB 阅读(215) 评论(0) 推荐(0) 编辑
摘要: A Compiler Mystery: We are given a C-language style for loop of type for (variable = A; variable != B; variable += C) statement;I.e.,... 阅读全文
posted @ 2018-04-06 14:28 KirinSB 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 青蛙的约会Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 124016 Accepted: 26479Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发... 阅读全文
posted @ 2018-04-06 13:34 KirinSB 阅读(155) 评论(0) 推荐(0) 编辑