ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1161. Stripies

I guessed - can someone explain why?
Послано Steve 24 июн 2013 06:37
I got AC on this simply by guessing that combining the stripies from the largest down to the smallest would result in the smallest colony size. Can someone explain what mathematical or logical reasoning would be used to arrive at this conclusion, or prove that this conclusion would be true?
Re: I guessed - can someone explain why?
Послано mberdyshev 12 янв 2016 23:18
I guessed the same and also I want to know mathematical proof
Re: I guessed - can someone explain why?
Послано stomakun 21 мар 2016 20:13
The factor 2 does not matter -- you will always find one 2 which was sqrt'ed (n-1) times, ..., one 2 not sqrt'ed.
OOH, there will be exactly two given number which got sqrt'ed (n-1) times, ..., one given number that got sqrt'ed once.
Therefore, you will want larger numbers be sqrt'ed more times.


Edited by author 22.03.2016 12:08
Re: I guessed - can someone explain why?
Послано IlushaMax 30 мар 2017 21:34
I can explain
Okay, we have sequence m1,m2,m3,m4.... of weights in input
But now imagine that we have a heap of stripies with their weights.
Our answer (for example n=4) will be:
2*sqrt(m1*2*sqrt(m2*2*sqrt(m3*m4))) for greater understanding write it on a sheet.
So we need to maximize it but we don't know order of m1,m2,m3,... which give max answer.
It's clear that if 2*sqrt(m1*2*sqrt(m2*2*sqrt(m3*m4))) should be maximum then m1*2*sqrt(m2*2*sqrt(m3*m4)) (in sqrt) should be maximum too.
Reasoning in this way we understand that we need m3*m4 be maximum. So this sequence should be sorted in this way: m4>=m3>=m2>=m1
I hope my English is enough to explain it))))

Edited by author 31.03.2017 19:50