Home Page | Web Board | Problems | Standing | Status | Statistics | Award Contest |
Contest - POJ Monthly--2007.08.05
Start time: 2007-08-05 12:00:00 End time: 2007-08-05 17:30:00
Current System Time: 2007-08-06 17:17:23.850 Contest Status:
Ended
Problem ID | Title |
3241 Problem A | Object Clustering |
3318 Problem B | Matrix Multiplication |
3319 Problem C | Dragon Slayer Qualification Exam |
3320 Problem D | Jessica's Reading Problem |
3321 Problem E | Apple Tree |
3322 Problem F | Roll Box I |
3323 Problem G | Roll Box II |
3324 Problem H | Lucas-Lehmer Test |
[Standings] [Status] [Statistics]
Contest Report |
Problem A: Object Clustering The problem is the same as to find the N-K smallest edge in the MST. As there are 10000 points, it is impossible even to calculate the length of all edges(10000 กม 10000). But we shall see there are many edges that are impossible to be in the MST: if dij = dik + dkj, then (i,j) won't be in the tree. Then the number of edges is at most 500*2*10000, but in fact the number is much smaller. Use a simple DP or a good enum can rule out these redundant calculation. Then we use a Kruskal algorithm to construct the tree and can just get the answer when we go to the (N-K)th edge in the MST. Problem B: Matrix Multiplication The author gives an approximate algorithm rather than a precise one. Randomize a n กม1 matrix X, test if the equation A กม B กม X = C กม X holds true. If it is not true we can safely say "NO" to this problem. If it is true, the possibility that A กม B กู X is extremely little. Problem C: Dragon Slayer Qualification Exam You may notice two important things in this problem:
Problem D: Jessica's Reading Problem For every page in the book, evaluate the shortest section starting from the page that covers all the ideas. A good data structure such as heap will reduce the time complexity thus meet the time limit. Problem E: Apple Tree If we label the forks with their DFS-visit-time, then a sub-tree is a consecutive interval of labels. Then we can use segment-tree to handle this problem. Problem F: Roll Box I There're three states for the box on every cell, standing up, lying down towards right and lying down towards bottom. Therefore at most 500*500*3 states exists for the box so flood-fill works. Problem G: Roll Box II Use any method to calculate a part of the plane, like [-10,10] กม [-10,10]. You'll find some pattern hidden in it. Problem H: Lucas-Lehmer Test The solution idea is quite straightforward: evaluate the sequence {si} modulo Mp. In order to exploit the property of Mp being one less than a power of two, it is better to use binary in arbitrary precision arithmetic, which will simplify the process of taking modulo and conversion to hexadecimal. |
All Rights Reserved 2003-2007 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator