TGTGInsightтелеграм анализLIVE / telegram public index
← Такты, стеки, два колеса

TGINSIGHT SIMILAR POSTS

Намери подобно съдържание

Изходен канал @clockstackwheels · Post #1084 · 9.04

В общем, была задача на оптимизацию плана работ: есть набор заказов, и в каждом N тасков. Таски могут зависеть друг от друга или нет, имеют длительность и тип. Ещё есть M работников, каждый из которых может выполнять таски только определённых типов, причём, у каждого своя скорость. Если все таски в заказе выполнены, фирма получает сколько-то денег. У заказа есть дедлайн, за просрочку штраф (за каждый день просрочки), который вычитается из цены заказа. И ещё фирма тратит деньги за каждый день своей работы независимо от того, как загружены её сотрудники (то есть просто платит зарплаты по сути). Ещё важен учёт праздников и выходных. Нужно заработать на определённом наборе заказов и работников как можно больше денег. Полный текст задачи и код программы проверки есть в репозитории. Эта задача является изменённым заказом, который мы с напарником решали в реальной жизни: оптимизация работы печатных станков для типографии. Правда, тогда и мы справились так себе, и заказчик в итоге сначала захотел всё вручную сам делать, а потом и вовсе похоронил проект при смене директора. !!! Не читайте дальше, если хотите сначала попробовать решить самостоятельно, потому что я сейчас опишу эффективные подходы и результаты. ________________________________________ Так вот. Мы с другим экспертом Андреем сразу сели и написали разные варианты, чтобы задать шкалу, по которой будем оценивать решения команд. За пару часов я собрал примитивный жадный алгоритм, который сортировал заказы по прибыльности и укладывал в сетку кое-как, это дало нам нижнюю оценку. Мой алгоритм заработал ~75 млн виртуальных рублей, мы решили для оценки поставить нижней границей 40 млн. То есть всё, что ещё ниже, оценивалось в ноль баллов за качество оптимизации. Затем Андрей закрылся дома на три дня и вышел на свет со сложным жадным алгоритмом, который очень хитро сортировал заказы и очень хитро укладывал их в сетку, попутно выбирая разные способы этой укладки в зависимости от конкретного заказа. Это позволило заработать ~275 млн рублей. Мы сделали верхней границей для оценки 280 млн. К сожалению, в итоге только две команды из десяти прошли нижнюю границу, заработав, соответственно, ~91 и ~105 млн. К верхней границе не приблизился никто. И у четырёх команд алгоритм вообще не смог уложить без нарушений задачи в сетку (то есть, например, произвольно менял длительности, накладывал задачи друг на друга, давал одному работнику две задачи в один момент и так далее). Важной ошибкой команд, на мой взгляд, являлся тот факт, что никто не воспользовался возможностью запустить алгоритм на несколько минут и дать ему поработать. По условиям задания, можно было тянуть до 5 минут на одну оптимизацию, но по факту решения команд отрабатывали за единицы и десятки секунд. На самом конкурсе, пока команды работали, я решил попробовать сделать быстрое (по времени написания) но эффективное решение. Сначала попробовал жадную сортировку + доведение до лучшего варианта методом имитации отжига. В качестве нового состояния я просто менял местами заказы целиком. Этот вариант работал пару минут и дал мне около ~200 млн дохода. К слову, команда-лидер использовала такой же подход, просто не докрутила число итераций и температуру. Ну и потом я взял готовую либу по реализации классической генетики с особями и скрещиванием. Особью был массив с приоритетами заказов (которые конечно же нужно было аккуратно уложить чистым алгоритмом). Тип скрещивания: scattered. Всего 15 поколений по 20 особей, и это за минуту-полторы давало ~230-240 млн. Считаю, что для конкурса это самый лучший выбор: пишется одним человеком за день и даёт почти максимум, при этом легко настраивается на нужную длительность работы, легко параллелится. Ну а потом уже дома я посидел и накодил свой вариант сложного жадного с плавающим окном перебора отсортированных заказов и плавающей же укладкой по работникам. Такая штука за две минуты зарабатывает ~281 млн. Но за три дня в условиях стресса я бы такое не сделал, скорее всего. #dev

Hashtags

Резултати

Намерени 5 подобни публикации

Търсене: #russianamibia

当前筛选 #russianamibia清除筛选
Russian MFA 🇷🇺

@MFARUSSIA · Post #28014 · 15.01.2026 г., 06:04

🎙Statement by Russia's Foreign Minister Sergey Lavrov at a joint press conference with Minister of International Relations and Trade of the Republic of Namibia Selma Ashipala-Musavyi (January 14, 2026, Moscow) Read in full 💬Sergey Lavrov: We reaffirmed that the friendly ties between Moscow and Windhoek are developing steadily and rest on the principles traditional for our relations – equality, solidarity, mutual respect and support. We highly value the fact that our Namibian friends remember well the assistance provided by the Soviet Union during the struggle against colonialism and in laying the foundations of statehood. We welcomed the intention of Namibia’s new leadership, personally President Netumbo Nandi-Ndaitwah, to deepen ties with Russia. We spoke in favour of expanding dialogue, including at the highest and high levels. We are certainly interested in resuming the practice of regular foreign-policy consultations. 🤝 We highly assessed inter-party cooperation. In February 2024, the South West Africa People’s Organization (SWAPO) supported the initiative of the political party United Russia to establish the Forum of Supporters of the Fight against Modern Practices of Neocolonialism. By decision of the UN General Assembly, December 14 each year will be marked as the International Day against Colonialism in All Its Forms and Manifestations. We consider this a fundamentally important decision, as after African friends gained political independence, economic dependence on the West persisted. In recent years, we have even observed this dependence deepening. Therefore, what we call the “second awakening of Africa” is a highly relevant issue on the international agenda. 📈 We agreed to make additional efforts to intensify trade and economic cooperation. Another area with clear prospects and solid groundwork already in place is healthcare. Training of personnel has traditionally been an integral part of our cooperation. Many thousands of Namibians have received education in Russia or the USSR. This practice continues today. Tourism is another sphere with evident potential. We reaffirmed our readiness to continue assisting our Namibian friends on international platforms, including through the provision of humanitarian assistance via the UN World Food Programme. We share a common view on the success of the Russia-Africa Partnership Forum, established at the initiative of the heads of state of Russia and African countries, and note identical or very close positions on most, if not all, items of the international and regional agenda. We underscored the need to improve the UN’s working methods, including the Security Council refor. We consistently support Africa’s fair demands to increase its representation in the Security Council. We expressed gratitude to our Namibian friends forsupporting all initiatives promoted by Russia at the UN, including those of particular importance in today’s international environment – the inadmissibility of the glorification of Nazism, countering neocolonial practices, cooperation in information security, ensuring the peaceful use of outer space, as well as disarmament initiatives. Special attention was paid to African issues, including the situation in eastern Democratic Republic of the Congo and developments in the Saharo-Sahel region. 🌍 We consistently advance the concept that solutions to African problems should be sought by African countries themselves. External actors must respect the approaches developed by Africans and provide possible assistance in their practical implementation. #RussiaNamibia

Russian MFA 🇷🇺

@MFARUSSIA · Post #28008 · 14.01.2026 г., 14:00

🎙 Russia's Foreign Minister Sergey Lavrov’sopening remarks during talks with Minister of International Relations and Trade of the Republic of Namibia Selma Ashipala-Musavyi(Moscow, January 14, 2026) 💬Sergey Lavrov: Ms Minister, Dear Selma, Colleagues, Friends, We are glad to welcome you in Moscow. We arranged this visit, when we were meeting in Cairo on the sidelines of the Second Ministerial Conference of the #RussiaAfrica Partnership Forum in December 2025. Now we are acting on this agreement. We appreciate the rich history and traditions of friendship in relations with your country, starting with the period, when the Soviet Union was helping you to gain independence and lay down the foundations of your statehood. March 2025 marked 35 years since the Namibian people won independence. President of Russia Vladimir Putin sent a message of greetings to President of Namibia Netumbo Nandi-Ndaitwah on the occasion of this anniversary. We see solidarity with regard to Russia and a shared sympathy, as well as the intention on the part of our peoples and governments to promote political dialogue, economic cooperation, and humanitarian contacts. As you and I discussed in Cairo, we will be happy to receive President Netumbo Nandi-Ndaitwah in the Russian Federation. We noted that all previous presidents of your country had visited Moscow. Today, there is a good pretext for discussing in detail the state of our bilateral relations and mapping out ways for their expansion, particularly in the economy, trade, and investment, as well as for comparing notes on regional African problems. There are quite a few of these, and Namibia is pro-active in settling them. We will also discuss issues related to the activities of the United Nations and other global organisations. You are welcome once again. We are glad to see you. #RussiaNamibia

Russian MFA 🇷🇺

@MFARUSSIA · Post #28809 · 21.03.2026 г., 20:30

🇳🇦 On March 21, #Namibia marks the 36th anniversary of its independence, achieved after decades of colonial rule and a prolonged liberation struggle. European colonisation of what is now Namibia began in the mid-XIXth century. In 1878, the British took control of the area around Walvis Bay. In the 1890s, the rest of the country became a German protectorate known as German South West Africa, which lasted for about 30 years. In 1904-1907, an uprising of the indigenous population against German colonial rule broke out. It was suppressed with extreme brutality by Berlin and the local administration, with little regard for human life: Europeans killed approximately 65'000 of the Herero population (up to 80%) and 10'000 of the Nama people (50%). In 1960, Namibian patriotic forces set up the South West African People's Organisation that launched the struggle for the country’s independence, recognised as legitimate by the UN. In 1967, the UN Council for South-West Africa was established. The Soviet Union was among the first to support the Namibian people in their struggle for independence and self-determination, which was achieved in 1990. Symbolically, diplomatic relations between our countries were also established on March 21, 1990. 🇷🇺🇳🇦 Moscow and Windhoek maintain a regular trust-based political dialogue at the highest and high levels. Over the past two years, Russia's Foreign Minister Sergey Lavrov has held four bilateral meetings with Namibian counterparts, including recent talks in Moscow with the Minister of International Relations and Trade of the Republic of Namibia Selma Ashipala-Musavyi, who visited Russia on a working trip in January 2026. 💬 Russia’s Foreign Minister Sergey Lavrov: The friendly ties between Moscow and Windhoek are developing steadily and rest on the principles traditional for our relations – equality, solidarity, mutual respect and support. We highly value the fact that our Namibian friends remember well the assistance provided by the Soviet Union during the struggle against colonialism and in laying the foundations of statehood. (from Russia's Foreign Minister Sergey Lavrov's statement and answers to media questionsat a joint press conference with Minister of International Relations and Trade of the Republic of Namibia Selma Ashipala-Musavyi following talks in Moscow on January 14, 2026) Russia and Namibia share or have similar positions on most issues of the global and regional agenda. Extensive experience has been accumulated in bilateral cooperation across trade, economic, scientific and educational, humanitarian and other areas. 🎓Many thousands of Namibians have received education in the Russian Federation or the Soviet Union. Russia also supports Namibia at international platforms, including through humanitarian assistance provided via the UN World Food Programme. 🤝 We extend our best wishes to our Namibian friends and colleagues on the occasion of their national holiday and the anniversary of the establishment of diplomatic relations between our countries. We reaffirm the unwavering commitment to consistently expanding bilateral ties. #RussiaNamibia