Advertisement
AquaBlitz11

TechJam 2018, Grand Final, Code Squad (Coding)

Nov 8th, 2018
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. Abridged Problem Statement for
  2. TechJam Thailand 2018, Grand Final, Code Squad
  3.  
  4. Round 2 - Coding
  5. Time: 3 hours 30 minutes
  6. Penalty is calculated as (the time you obtain your maximum score) + 10*(number of wrong submissions on AC'd problems)
  7.  
  8. ==============================
  9.  
  10. Problem A - Intercept Meteor (Max. 20 pts)
  11.  
  12. Given a list of N points on 2D plane. These form a convex polygon in clockwise order, starting from the leftmost point (pick bottom point if there are multiple leftmost points). Given K queries, each query is denoted by (x,y). Answer whether (x,y) is "Inside," "Outside," or "On the boundary."
  13.  
  14. -10^9 <= x,y <= 10^9
  15. No three points are colinear.
  16. Small (8 pts): 3 <= N <= 1000, 1 <= K <= 1000
  17. Large (12 pts): 3 <= N <= 100000, 1 <= K <= 100000
  18. Time limit: 1 second, Memory limit: 128 MiB
  19.  
  20. ==============================
  21.  
  22. Problem B - Finding Peep Chan (Max. 20 pts)
  23.  
  24. Given an N x M grid. Initially, there's a cat inside one of these cells. In a day, the cat can move up/down/left/right one block or use one of the K shortcuts linking between cell (x1,y1) and cell (x2,y2), if it's standing on one of the endpoints. You don't know where the cat is. The cat may be in any cell with equal probability (1/NM for each block). You can use one of the two operations
  25. 1) Query (x,y) - You will know the length of the shortest path from cell (x,y) to the cat's cell.
  26. 2) Help (x,y) - If the cat is at (x,y), your mission is completed. If it's not, nothing happens.
  27. This is your procedure for helping the cat, in order:
  28. 1) Use Query once on some point to get a hint of the cat's position.
  29. 2) If you can guarantee the cat's position, use Help immediately then end the process.
  30. 3) If not, wait until the next day. The cat will move exactly once while you wait.
  31. 4) Use Query once again (you can use a different point) to get another hint.
  32. 5) Use Help immediately (even if you can't guarantee the cat's position, you can still try to maximize your chance.)
  33. Find the maximum probability you could save the cat if you follow the procedure and pick optimal (x,y) points for querying.
  34.  
  35. Small (8 pts): 1 <= N, M <= 20, NM <= 200, 1 <= K <= 100
  36. Large (12 pts): 1 <= N, M <= 20, 1 <= K <= 70000
  37. Time Limit: 2 seconds, Memory Limit: 128 MiB
  38.  
  39. ==============================
  40.  
  41. Problem C - Stable Molecule (Max. 20 pts)
  42.  
  43. Given a tree consisting of N nodes. Label every node with a positive integer. It's allowed to use the same number for multiple nodes. Count the number of ways to label every node such that for each node u and v connected through an edge, product of label of u and label of v must not exceed P.
  44.  
  45. 1 <= N <= 1000
  46. Small (8 pts): 1 <= P <= 10^3
  47. Large (12 pts): 1 <= P <= 10^9
  48. Time Limit: 2 seconds, Memory Limit: 128 MiB
  49.  
  50. ==============================
  51.  
  52. Problem D - Rotate Sort (Max. 18 pts)
  53.  
  54. Given an array A of size N. You can use operation (p, q) where 1 <= p <= q <= N to transform array A[1..N] into A[(q+1)..N]+A[p..q]+A[1..(p-1)]. Minimize the number of operations you need to sort array A in ascending order.
  55.  
  56. Scoring Scheme
  57. For each test case, if your solution is invalid, you gain 0 points. Otherwise:
  58. Let K = the number of operations you need for this test case.
  59. Let K* = the minimum number of operations in every contestant's solution.
  60. Your score is 18 if K = K*, 6 + 9(K*/K) otherwise. (A valid solution is guaranteed to obtain at least 6 points. Sub-optimal solution can earn at most 15 points.)
  61. Your final score for this problem is calculated as the average of all test cases' score.
  62.  
  63. 1 <= N <= 100
  64. Time Limit: 1 second, Memory Limit: 128 MiB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement