![]() |
Weekly Problems #01 |
Pedro Ribeiro - DCC/FCUP |
This is one of 11 weekly problem sets. Each one is worth 10% of the grade of the "Submitted Implementation" evaluation criteria.
6 proposed problems:
one cycle is enough, right?
when is the optimal time to use the button?
for the sample input we must modify the array to 3 3 5 5 7. Can you see why?
we must first find if the first letter of A occurs in B, right? afterwards, what is left to do? c
the answer matrix will have permutations in every row and column.
Can you think of such a matrix?
Think about one row: can you reach your desired final state by reversing subarrays?
And if you can use at most 2n operations, can you do it in two operations per row?
Think about divisors: knowing the number of trailing zeros is the same as asking how many times it can be divided by... 10, right?
But how can you compute this efficiently? (use a bit of math and don't stop thinking if the solution does not immediate - good problems need time for you to think!)
About the delivery:
Pedro Ribeiro - DCC/FCUP | Last update: