Advertisement
AquaBlitz11

TechJam 2018, Grand Final, Code Squad (Ponder)

Nov 9th, 2018
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.70 KB | None | 0 0
  1. Abridged Problem Statement for
  2. TechJam Thailand 2018, Grand Final, Code Squad
  3.  
  4. Round 1 - Ponder
  5. - 5 minutes for each problem.
  6. - Timer starts as soon as problem statement ends.
  7. - The contestant must arrive at an answer by using a given mini-whiteboard or their laptop.
  8. - The answer must be written and clearly marked as such on the whiteboard or laptop.
  9. - Contestant must rush to take the flag in the middle of the play field. No answer modification afterward.
  10. - After 5 minutes is up, judges will check each contestant's answer for scoring.
  11. - First to solve gets 7 points. Second to solve gets 6 points. Other solvers get 5 points.
  12.  
  13. Problem names, grouping and order here may be different from the actual competition. (I can't remember.)
  14.  
  15. ==============================
  16.  
  17. Group A - Problem 1
  18. Vault Passcode
  19.  
  20. There's a vault which requires 6-digit passcode to unlock. Let's call it S.
  21. You also know that for each 6-digit string T[i], the length of the longest common substring of S and T[i] is A[i].
  22. Given T[1..N] and S[1..N] (which I can't remember), find the passcode. (It's guaranteed to be unique.)
  23.  
  24. ------------------------------
  25.  
  26. Group A - Problem 2
  27. Array Counting
  28.  
  29. Let's say we have an array A of size N and these conditions:
  30. - 0 <= A[i] <= N-1, for all i where 0 <= i <= N-1
  31. - A[i] <= A[i+1], for all i where 0 <= i <= N-2
  32. - A[i] = A[A[i]], for all i where 0 <= i <= N-1
  33.  
  34. Count the number of array A of size N=20 satisfying all three conditions.
  35.  
  36. ------------------------------
  37.  
  38. Group A - Problem 3
  39. 3-term Arithmetic Progression
  40.  
  41. Let's define 3-term Arithmetic Progression (3AP) as an arithmetic sequence consisting of exactly 3 numbers.
  42. Build a sequence of positive integers not exceeding 30 such that there are no subsequences which are 3AP.
  43. Maximize the length of the sequence.
  44.  
  45. ==============================
  46.  
  47. Group B - Problem 1
  48. Energy Consumption
  49.  
  50. There are 1,000,000 creatures of the same species in an isolated environment. Each creature initially stores 1,000,000 kcal. of energy. At any given time, a creature (let's call it A) may decide to eat another creature (let's call it B). A will gain exactly half of B's energy (fractional value is possible) while B will be removed from the environment. There's also an additional limit: for every creature X, X can only eat at most 3 other creatures.
  51.  
  52. In the final state where there's only one creature left...
  53. - what's the minimum energy possible for that creature?
  54. - what's the maximum energy possible for that creature?
  55.  
  56. ------------------------------
  57.  
  58. Group B - Problem 2
  59. Student Classroom
  60.  
  61. There are N students, labeled A, B, C, ... They are separated into two classes: Class 1 and Class 2.
  62. Given M conditions in form of "x and y must be in different classes."
  63. (Can't remember what N, M, and the conditions are.)
  64. Remove 2 conditions such that there's a valid class separation scheme.
  65.  
  66. - Find the two conditions to be removed.
  67. - Find a list of students in the same class as student A.
  68.  
  69. ------------------------------
  70.  
  71. Group B - Problem 3
  72. Magic Square
  73.  
  74. Fill number 1 through 16 into a 4x4 board such that
  75. - cell values are pairwise distinct
  76. - the sum of values in row i must be equal to the sum of values in column i, for all 1 <= i <= 4
  77.  
  78. Give one such valid solution.
  79.  
  80. ==============================
  81.  
  82. Group C - Problem 1
  83. Tetris Tiling
  84.  
  85. Consider fitting Tetrominoes into a finite two-dimensional grid. (Tetrominoes are pieces from the game Tetris: I, L, J, S, Z, O and T pieces, including all of their rotations.) We'll define "gap length" as sum of the length of line segments which are right between two adjacent tiles.
  86.  
  87. If you have to fit 27 pieces into 12 by 9 grid,
  88. - what's the minimum gap length you could have?
  89. - what's the maximum gap length you could have?
  90.  
  91. ------------------------------
  92.  
  93. Group C - Problem 2
  94. Currency System
  95.  
  96. Consider a currency system where the possible denominations are 1, 2, 5, 10, 20, 50, 100, 500 and 1000. It's obvious that for any sums of money, greedy algorithm for finding minimum number of coins/banknotes used always outputs optimal answer.
  97.  
  98. Add one denomination such that there exists a counterexample where greedy algorithm outputs sub-optimal answer.
  99. - What's the maximum value of such denomination?
  100. - Give one counterexample to the greedy algorithm when that denomination exists in the system.
  101.  
  102. ------------------------------
  103.  
  104. Group C - Problem 3
  105. Hamiltonian Tiling
  106.  
  107. Consider building a shape with a lot of 1x1 blocks where
  108. - each block's sides must be perfectly aligned with other blocks, and
  109. - there are no holes in the shape.
  110.  
  111. Let's define a Hamiltonian Cycle as a *cyclic* sequence of blocks such that
  112. - for block x and y which are adjacent in the sequence, y is reachable from x within 1 unit of movement (up/left/right/down),
  113. - each block is visited exactly once
  114.  
  115. We want to build a shape such that these conditions hold:
  116. - there exists a *unique* Hamiltonian cycle in the shape, and
  117. - there's exactly one way to split blocks into two groups such that each group of blocks has a unique Hamiltonian cycle.
  118.  
  119. For example, 8 blocks forming 2x4 rectangle is a valid solution because
  120. - there exists exactly one Hamiltonian cycle, and
  121. - the only way to split is to split into 2x2 rectangle, each of which also has a unique Hamiltonian cycle.
  122.  
  123. Build a shape consisting of exactly 32 blocks following the conditions.
  124.  
  125. ==============================
  126.  
  127. Group D - Problem 1
  128. Picture Hanging
  129.  
  130. Let's say you want to hang a picture with a rope.
  131. There are three pins on the wall: A, B, C from left to right.
  132. Find a way to tie the rope around the pins satisfying these conditions:
  133. - If one of A or C is removed, the picture doesn't fall.
  134. - If B is removed, the picture falls.
  135. - If both A and C are removed, the picture falls.
  136.  
  137. ------------------------------
  138.  
  139. Group D - Problem 2
  140. Greedy Traveling Salesman
  141.  
  142. There are 12 points lying on a Euclidean space like this:
  143. 1 2 3 4
  144. 5 6 7 8
  145. 9 10 11 12
  146. Each pair of adjacent points on the same row or column is exactly one unit apart.
  147.  
  148. Let's say we have an algorithm to solve TSP greedily:
  149. - pick an arbitrary starting point
  150. - move toward the nearest point which hasn't been visited yet
  151. - once all points are visited, return to the starting point to form a cycle
  152. In case there are multiple "nearest points," pick one arbitrary.
  153.  
  154. In the best case scenario, the algorithm might output something like 1, 2, 3, 4, 8, 12, 11, 7, 6, 10, 9, 5 which has the total distance equals 12. But, there are also cases where the algorithm performs badly.
  155.  
  156. Find one possible output from the greedy TSP algorithm where total distance >= 160/9.
  157.  
  158. ------------------------------
  159.  
  160. Group D - Problem 3
  161. Prime Number
  162.  
  163. Find longest sequence of consecutive prime numbers which sums to 10^6.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement