Nu aveti permisiuni pentru a descarca fisierul grader_test5.ok
Diferente pentru problema/jupanul intre reviziile #19 si #20
Nu exista diferente intre titluri.
Diferente intre continut:
h2. Exemplu table(example). |_. jupanul.in |_. jupanul.out |
| 63| 6 1638
| 6 2 | 6 16
|
table(example). |_. jupanul.in |_. jupanul.out |
| 12152 8 | 12152 27468 57294 111704 207030 369846 642894 1093344
|
|
h3. Explicaţie
Intr-un termen
* $[6]$
* [6], cost=gcd([6])=6 Deci $f(6,1)=6$
In $2$ termeni
* $[1, 6]$ * $[6, 1]$ * $[2, 3]$ * $[3, 2]$ In $3$ termeni * $[1, 1, 6]$ * $[1, 2, 3]$ * $[1, 3, 2]$ * $[1, 6, 1]$ * $[2, 1, 3]$ * $[2, 3, 1]$ * $[3, 1, 2]$ * $[3, 2, 1]$ * $[6, 1, 1]$
* [1,6], cost=gcd([1]) + gcd([1,6])=1+1=2 * [6,1], cost=gcd([6]) + gcd([6,1])=6+1=7 * [2,3], cost=gcd([2]) + gcd([2,3])=2+1=3 * [3,2], cost=gcd([3]) + gcd([3,2])=3+1=4 Deci $f(6,2)=2+7+3+4=16$
== include(page="template/taskfooter" task_id="jupanul") ==
