A hard DP problem

Правка en1, от ariel.nowik, 2019-01-14 02:14:31

[submission:https://codeforces.com/contest/1082/problem/F]

Hi. I will explain my approach to solve this hard and counter-intuitive problem.

The problem

You've got some telephone numbers. Each number is dialed a given amount of times. You would need to do an amount of key presses to dial all numbers, that is well defined. However there is an amount of special buttons that can be used to type several digits at once. The buttons can only be used at the start of a number (before manually typing anything). Buttons presses does not count as digit press. Buttons can only be used once per number. You need to decide how to place k buttons to minimize total digit presses.

** First insight **

We need to build a trie structure of the numbers, this will allow us to exploit numbers that have something in common

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский ariel.nowik 2019-01-14 05:46:41 36 Tiny change: '6.png)\n\n**Nee' -> '6.png)\n\n(Example of trie of test case 1)\n\n**Nee'
en2 Английский ariel.nowik 2019-01-14 05:43:57 3255 (published)
en1 Английский ariel.nowik 2019-01-14 02:14:31 924 Initial revision (saved to drafts)