Cerinta completa Little Walter likes playing with his toy scales. He has types of weights. The weight type has weight . There are infinitely many weights of each type. Recently, Walter defined a function, , denoting the number of different
Counting Special Sub-Cubes
Cerinta completa Given an cube, let (where ) denote the value stored in cell . A sub-cube (where ) of an cube is considered to be special if the maximum value stored in any cell in the sub-cube is equal
Counting Valleys
Cerinta completa An avid hiker keeps meticulous records of their hikes. During the last hike that took exactly steps, for every step it was noted if it was an uphill, , or a downhill, step. Hikes always start and end
Count Strings
Cerinta completa A regular expression is used to describe a set of strings. For this problem the alphabet is limited to ‘a’ and ‘b’. We define to be a valid regular expression if: 1) is “” or ““. 2) is
Counting Road Networks
Cerinta completa Lukas is a Civil Engineer who loves designing road networks to connect cities numbered from to . He can build any number of bidirectional roads as long as the resultant network satisfies these constraints: It must be possible
Counter game
Cerinta completa Louise and Richard have developed a numbers game. They pick a number and check to see if it is a power of . If it is, they divide it by . If not, they reduce it by the
Counting Sort 1
Cerinta completa Comparison Sorting Quicksort usually has a running time of , but is there an algorithm that can sort even faster? In general, this is not possible. Most sorting algorithms are comparison sorts, i.e. they sort a list just
Correctness and the Loop Invariant
Cerinta completa In the previous challenge, you wrote code to perform an Insertion Sort on an unsorted array. But how would you prove that the code is correct? I.e. how do you show that for any input your code will
Coprime Paths
Cerinta completa You are given an undirected, connected graph, , with nodes and edges where . Each node is initially assigned a value, , that has at most prime divisors. You must answer queries in the form u v. For
Count Scorecards
Cerinta completa In a tournament, players play against each other exactly once. Each game results in exactly one player winning. There are no ties. You have been given a scorecard containing the scores of each player at the end of
