摘要: Problem DescriptionConsider a Depth-First-Search(DFS) spanning tree T of a undirected connected graph G, we define a T-Simple Circle as a path v1, v2, ..., vk(v1= vk) in G that contains at most one edge which not belongs to the DFS spanning tree T.Given a graph G, we process DFS on G starting from v 阅读全文
posted @ 2013-08-22 19:50 Oyking 阅读(675) 评论(0) 推荐(0) 编辑
摘要: Problem Description Let f(x) = anxn+...+ a1x +a0, in which ai(0 = 3, otherwise abs(ai) 2 #include 3 #include 4 #include 5 using namespace std; 6 typedef long long LL; 7 8 const int MAXN = 8; 9 10 int T, deg;11 LL phi;12 LL a[MAXN];13 14 LL f(LL x, LL m) {15 LL ret = 0, xx = 1;16 for(in... 阅读全文
posted @ 2013-08-22 14:25 Oyking 阅读(451) 评论(5) 推荐(0) 编辑
摘要: Problem Description Bob gets tired of playing games, leaves Alice, and travels to Changsha alone. Yuelu Mountain, Orange Island, Window of the World, the Provincial Museum etc...are scenic spots Bob wants to visit. However, his time is very limited, he can’t visit them all. Assuming that there are.. 阅读全文
posted @ 2013-08-22 12:25 Oyking 阅读(382) 评论(0) 推荐(0) 编辑
摘要: Problem Description A sequence Snis defined as:Where a, b, n, m are positive integers.┌x┐is the ceil of x. For example, ┌3.14┐=4. You are to calculate Sn. You, a top coder, say: So easy!Input There are several test cases, each test case in one line contains four positive integers: a, b, n, m. Whe... 阅读全文
posted @ 2013-08-22 00:05 Oyking 阅读(419) 评论(0) 推荐(1) 编辑