В общем, была задача на оптимизацию плана работ: есть набор заказов, и в каждом N тасков. Таски могут зависеть друг от друга или нет, имеют длительность и тип. Ещё есть M работников, каждый из которых может выполнять таски только определённых типов, причём, у каждого своя скорость.
Если все таски в заказе выполнены, фирма получает сколько-то денег. У заказа есть дедлайн, за просрочку штраф (за каждый день просрочки), который вычитается из цены заказа. И ещё фирма тратит деньги за каждый день своей работы независимо от того, как загружены её сотрудники (то есть просто платит зарплаты по сути). Ещё важен учёт праздников и выходных.
Нужно заработать на определённом наборе заказов и работников как можно больше денег. Полный текст задачи и код программы проверки есть в репозитории. Эта задача является изменённым заказом, который мы с напарником решали в реальной жизни: оптимизация работы печатных станков для типографии. Правда, тогда и мы справились так себе, и заказчик в итоге сначала захотел всё вручную сам делать, а потом и вовсе похоронил проект при смене директора.
!!! Не читайте дальше, если хотите сначала попробовать решить самостоятельно, потому что я сейчас опишу эффективные подходы и результаты.
________________________________________
Так вот. Мы с другим экспертом Андреем сразу сели и написали разные варианты, чтобы задать шкалу, по которой будем оценивать решения команд. За пару часов я собрал примитивный жадный алгоритм, который сортировал заказы по прибыльности и укладывал в сетку кое-как, это дало нам нижнюю оценку. Мой алгоритм заработал ~75 млн виртуальных рублей, мы решили для оценки поставить нижней границей 40 млн. То есть всё, что ещё ниже, оценивалось в ноль баллов за качество оптимизации.
Затем Андрей закрылся дома на три дня и вышел на свет со сложным жадным алгоритмом, который очень хитро сортировал заказы и очень хитро укладывал их в сетку, попутно выбирая разные способы этой укладки в зависимости от конкретного заказа. Это позволило заработать ~275 млн рублей. Мы сделали верхней границей для оценки 280 млн.
К сожалению, в итоге только две команды из десяти прошли нижнюю границу, заработав, соответственно, ~91 и ~105 млн. К верхней границе не приблизился никто. И у четырёх команд алгоритм вообще не смог уложить без нарушений задачи в сетку (то есть, например, произвольно менял длительности, накладывал задачи друг на друга, давал одному работнику две задачи в один момент и так далее). Важной ошибкой команд, на мой взгляд, являлся тот факт, что никто не воспользовался возможностью запустить алгоритм на несколько минут и дать ему поработать. По условиям задания, можно было тянуть до 5 минут на одну оптимизацию, но по факту решения команд отрабатывали за единицы и десятки секунд.
На самом конкурсе, пока команды работали, я решил попробовать сделать быстрое (по времени написания) но эффективное решение. Сначала попробовал жадную сортировку + доведение до лучшего варианта методом имитации отжига. В качестве нового состояния я просто менял местами заказы целиком. Этот вариант работал пару минут и дал мне около ~200 млн дохода. К слову, команда-лидер использовала такой же подход, просто не докрутила число итераций и температуру.
Ну и потом я взял готовую либу по реализации классической генетики с особями и скрещиванием. Особью был массив с приоритетами заказов (которые конечно же нужно было аккуратно уложить чистым алгоритмом). Тип скрещивания: scattered. Всего 15 поколений по 20 особей, и это за минуту-полторы давало ~230-240 млн. Считаю, что для конкурса это самый лучший выбор: пишется одним человеком за день и даёт почти максимум, при этом легко настраивается на нужную длительность работы, легко параллелится.
Ну а потом уже дома я посидел и накодил свой вариант сложного жадного с плавающим окном перебора отсортированных заказов и плавающей же укладкой по работникам. Такая штука за две минуты зарабатывает ~281 млн. Но за три дня в условиях стресса я бы такое не сделал, скорее всего.
#dev
🇳🇦Se predice que Adolf Hitler ganará las próximas elecciones en Namibia
El político, de 59 años, fue elegido por primera vez en 2020 para representar la circunscripción de Ompundja, recibiendo el 85% del voto popular.
Adolf Hitler Uunona —en la foto— representa a la Organización del Pueblo de África Sudoccidental (SWAPO), de izquierda y anteriormente comunista, que ha gobernado Namibia desde que el país obtuvo su independencia de Sudáfrica en 1990.
#namibia
———
Únete a la lucha por la verdad en
📱Telegram
📱YouTube
📱X (Twitter)
#Namibia🇳🇦
Pink lakes in Namibia, located in the Valvis Bey area, are an amazing natural phenomenon. These lakes acquired a pink tint due to the high content of salt and minerals, as well as due to the presence of specific microorganisms.
Miguel Díaz-Canel Bermúdez
(@DiazCanelB) en X
Firmamos el libro de condolencias por el fallecimiento de Sam Nujoma, padre fundador y primer presidente de #Namibia. Reiteramos el profundo pesar por la muerte de uno de los mejores amigos de #Cuba. Siempre recordaremos sus muestras de respeto y cariño hacia nuestro pueblo.
https://x.com/DiazCanelB/status/1889397835449200723?t=PYcutPQjqmG2XBZbU4FErQ&s=19
🌎 The Brandberg Mountain in Namibia is famous for its mysterious White Lady rock painting, estimated to be at least 2,000 years old. Archaeologists debate whether the figure represents a woman, man, or ritual dancer, and the exact meaning of the painting remains unclear. The site contains over 45,000 individual rock paintings. ✨
#archaeology⚡#Namibia⚡#mysteries
👉subscribe Interesting Planet
👉more Channels
🇳🇦 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
🌍 The Namib Sand Sea is the only coastal desert made entirely of shifting sand dunes recognized as a UNESCO World Heritage site, with winds constantly sculpting waves of sand along the Atlantic coast. ✨
#desert⚡#dunes⚡#Namibia⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
Okavango, Oil Drilling, and the Tragedy of Africa
It is not too late for the governments of Namibia and Botswana to halt the race for an asset that is bound to get stranded as the world shifts away from fossil fuels.
https://www.commondreams.org/views/2021/05/12/okavango-oil-drilling-and-tragedy-africa/
#Africa#Nature#Namibia
@LovelyNature
AREA assessed the potential for building solar power plants in Namibia by driving 1,000 km across the Kalahari Desert
In early December, the AREA delegation, headed by the Executive Secretary of the Board Andrey Gromov and a member of the Board of the Association, IBAC Director Yulia Berg, made a working visit to Namibia.
During the visit, meetings were held with developers of solar power plant construction projects, the energy company NamPower, representatives of government agencies, including the Investment Promotion and Development Council of Namibia, the Antimonopoly Commission, the Council of Traditional Leaders and the local council of one of the villages where solar power generation facilities could be built.
The delegation drove almost 1,000 km across the Kalahari Desert, allowing Russian and Namibian specialists to familiarize themselves with the current state of the energy infrastructure and the state of the power grid, as well as to assess the prospects for building new stations on site.
At the moment, Namibia is experiencing an acute energy deficit, especially during peak hours - in the mornings and evenings. However, the vast territory of the state and regions with high insolation allow us to confidently rely on solar generation not only as a way to cope with the deficit, but also as a potential for exporting electricity to neighboring countries.
#AREA#Africa#Namibia#energyAfrica
🌎 The Namib Desert is home to the world’s oldest living desert fairy circles—mysterious bare patches of earth surrounded by rings of grass. Scientists believe termites create these strange patterns by eating plant roots underground, shaping the desert’s landscape for centuries. ✨
#Namibia⚡#patterns⚡#termites
👉subscribe Interesting Planet
🇳🇦Глава национальной комисси по планированию Намибии на Всемирном экономическом форуме (ВЭФ) в Давосе заявил о планах по развитию атомной энергетики
⚛️Намибия планирует развивать сферу атомной энергетики в стране для снижения зависимости от импорта электроэнергии и обеспечения энергетической безопасности.
⚡️К сожалению, только 60% нашего населения имеют доступ к электричеству. В настоящее время мы импортируем 60% электроэнергии из Южной Африки. Поэтому нам необходимо обратить внимание на наши собственные внутренние ресурсы», — сказал глава Национальной комиссии по планированию (NPC) Каире Мбуенде
🪨
В связи с этим Мбуенде подчеркнул, что Намибия является первой страной в Африке по добыче урана и третьей в мире по этому показателю. Учитывая объемы ресурсов, власти государства рассматривают возможности развития атомной отрасли для долгосрочного решения энергетических проблем.
🤝По словам главы NPC, Намибия изучает перспективы использования малых модульных атомных реакторов и планирует сотрудничать с международными партнерами на континенте и за его пределами для обмена передовым опытом в сфере атомной энергетики.
#Новости_МеждународкаФМ
#AfricaNewsWithIYF
👉Read in ENG
👉Читайте нас в ВК
#Africa#Африка#Namibia#Намибия
On 23 March 2026, Ambassador of Russia to South Africa Roman Ambarov attended a Day of Reflection on Resistance and Liberation Heritage in commemoration of the Battle of Cuito Cuanavale at Freedom Park in Pretoria.
The keynote address was delivered by Deputy Minister of Sport, Arts and Culture of South Africa, Hon. Ms Peace Mabe. Among the participants were Hon. Ms Nomvula Mokonyane, First Deputy Secretary-General of the African National Congress, as well as heads of diplomatic missions from Cuba, Angola, and Namibia, ANC representatives, and veterans of the Battle of Cuito Cuanavale.
🎙 Addressing the participants, Ambassador Roman Ambarov emphasized that the Battle of #CuitoCuanavalewasa turning pointof the Civil War in Angola.
The victory of the People’s Armed Forces of Liberation of Angola contributed directly to the peace process in Namibia and helped pave the way for the eventual liberation of South Africa.
“Cuito Cuanavale became a symbol of resistance against oppression. It demonstrated that even in the face of overwhelming force, the determination of people fighting for their rights cannot be defeated. It was here that the tide began to turn - not only in Angola, but across the region.
The role played by the Soviet Union in supporting Angola during this difficult period remains an important part of this history. Through the various means of assistance and political support, it contributed to strengthening the defence of Angola’s sovereignty. Soviet advisers worked alongside Angolan and Cuban forces, sharing knowledge, resources, and a belief in a just cause.
But what truly defined this moment was solidarity to fight together against the colonial yoke. It was the understanding that the struggle of one people is the concern of all humanity. The fight in Angola echoed the voices of those resisting apartheid in South Africa and colonial rule in Namibia. It was one struggle, fought on many fronts,” the Russian Ambassador said.
As part of the event, Roman Ambarov laid wreath to the Russian section of the Wall of Names in memory of Soviet military specialists who participated in conflicts in Southern Africa.
ℹ️ The Battle of Cuito Cuanavale (August 1987 – March 1988) was a decisive engagement of the Angolan Civil War and a crucial step in the struggle for independence of the countries of Southern Africa from colonialism and apartheid. During the battle, the People’s Armed Forces of Liberation of Angola backed by #USSR, #Cuba, People’s Liberation Army of #Namibia, African National Congress (#ANC) and others defeated the combatants of the Angolan “UNITA” party and the racist regime of the Republic of South Africa supported by the US.
#RussiaSouthAfrica#AmbassadorAmbarov