Home Page | Web Board | Problems | Standing | Status | Statistics | Award Contest |
Contest - POJ Monthly - Good Luck to World Finalists--2007.03.04
Start time: 2007-03-04 12:00:00 End time: 2007-03-04 17:00:00
Current System Time: 2025-04-30 23:10:09.976 Contest Status:
Ended
Happy Lantern Festival!
Problem ID | Title |
3202 Problem A | A Very Simple Compiler |
3203 Problem B | Incremental Python Parsing |
3204 Problem C | Ikki's Story I - Road Reconstruction |
3205 Problem D | Ikki's Story II - War with TN |
3206 Problem E | Ikki's Story III - Rescue frkstyc! |
3207 Problem F | Ikki's Story IV - Panda's Trick |
3208 Problem G | Apocalypse Someday |
3209 Problem H | From Pythagoras to … |
[Standings] [Status] [Statistics]
Contest Report |
Problem A: A Very Simple Compiler The 16-bit width of half precision implies that the total number of possible values of Problem B: Incremental Python Parsing A segment tree is used to store the program, each node of the tree representing a consecutive code fragment. For each node, the following information about the corresponding code fragment is maintained in each modify operation in O(log n) time:
Notice that it is unnecessary to distinguish the three kinds of brackets because they are always matched when queries occur. For a query operation, consider all characters up to the position specified in the query. They divided into code fragments F1, F2, …, Fk in order, each represented by a node of the segment tree xi (1 ≤ i ≤ k), where k = O(log n). Starting with q0 = b0 = s0 = 0, for each i (1 ≤ i ≤ k), define:
sk will be the answer to the query. Problem C: Ikki’s Story I – Road Reconstruction It is easy to see that all the edges that Ikki needed to find must be saturated in some maximum flow. But not all saturated edges will satisfy his need. The point is that we have to decide whether a saturated edge is the only saturated one in a s-t path. If there is only one saturated edge in the path, increasing the capacity of this edge will surely lead to a larger maximum flow value. So we run some graph search algorithm on the residual network to see which vertices are reachable from source, then collect them in a set S; and which vertices the sink is reachable from, then collect them in a set T. If a saturated edge reaches from some vertex in S to another in T, it surely is one we need. Problem D: Ikki’s Story II – War with TN An O(N(N+ M)) algorithm will run too long. The author’s approach is based on two runs of breadth first search. The first run grows a breadth first search tree rooted at s and finds a shortest path from s to t p in terms of number of edges. Only vertices that appear in p are considered candidates. The second run determines for each vertex the shallowest vertex in p from which it can be reached without passing any edges in p. Then some vertex in p, if any of its tree descendants in p is connected to any of its ancestors by a path that is edge-disjoint from p, can be eliminated. Problem E: Ikki’s Story III – Rescue frkstyc! Consider adding the vertices one by one to the tree in increasing order of their designated numbers. It’s not difficult to draw a recurrence relation from the process. In fact you can prove a one-to-one correspondence between the answers and the Eulerian numbers. Problem F: Ikki’s Story IV – Panda’s Trick Observe that two links cross when both connected inside the circle iff they cross when both connected outside the circle. Use an undirected graph to represent the relations between links. If two links cross, their corresponding vertices are connected by an edge. Then a cross-free connection is possible iff the graph is bipartite. Problem G: Apocalypse Someday All numbers containing 666 can be considered as strings of the language defined by the regular expression Problem H: From Pythagoras to … A positive integer n is a sum of two squares iff all prime factors of n congruent to 3 modulo 4 have even exponents in the prime factorization of n. A proof requires knowledge of the Legendre symbol and Fermat’s two-square theorem. |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator