В общем, была задача на оптимизацию плана работ: есть набор заказов, и в каждом N тасков. Таски могут зависеть друг от друга или нет, имеют длительность и тип. Ещё есть M работников, каждый из которых может выполнять таски только определённых типов, причём, у каждого своя скорость.
Если все таски в заказе выполнены, фирма получает сколько-то денег. У заказа есть дедлайн, за просрочку штраф (за каждый день просрочки), который вычитается из цены заказа. И ещё фирма тратит деньги за каждый день своей работы независимо от того, как загружены её сотрудники (то есть просто платит зарплаты по сути). Ещё важен учёт праздников и выходных.
Нужно заработать на определённом наборе заказов и работников как можно больше денег. Полный текст задачи и код программы проверки есть в репозитории. Эта задача является изменённым заказом, который мы с напарником решали в реальной жизни: оптимизация работы печатных станков для типографии. Правда, тогда и мы справились так себе, и заказчик в итоге сначала захотел всё вручную сам делать, а потом и вовсе похоронил проект при смене директора.
!!! Не читайте дальше, если хотите сначала попробовать решить самостоятельно, потому что я сейчас опишу эффективные подходы и результаты.
________________________________________
Так вот. Мы с другим экспертом Андреем сразу сели и написали разные варианты, чтобы задать шкалу, по которой будем оценивать решения команд. За пару часов я собрал примитивный жадный алгоритм, который сортировал заказы по прибыльности и укладывал в сетку кое-как, это дало нам нижнюю оценку. Мой алгоритм заработал ~75 млн виртуальных рублей, мы решили для оценки поставить нижней границей 40 млн. То есть всё, что ещё ниже, оценивалось в ноль баллов за качество оптимизации.
Затем Андрей закрылся дома на три дня и вышел на свет со сложным жадным алгоритмом, который очень хитро сортировал заказы и очень хитро укладывал их в сетку, попутно выбирая разные способы этой укладки в зависимости от конкретного заказа. Это позволило заработать ~275 млн рублей. Мы сделали верхней границей для оценки 280 млн.
К сожалению, в итоге только две команды из десяти прошли нижнюю границу, заработав, соответственно, ~91 и ~105 млн. К верхней границе не приблизился никто. И у четырёх команд алгоритм вообще не смог уложить без нарушений задачи в сетку (то есть, например, произвольно менял длительности, накладывал задачи друг на друга, давал одному работнику две задачи в один момент и так далее). Важной ошибкой команд, на мой взгляд, являлся тот факт, что никто не воспользовался возможностью запустить алгоритм на несколько минут и дать ему поработать. По условиям задания, можно было тянуть до 5 минут на одну оптимизацию, но по факту решения команд отрабатывали за единицы и десятки секунд.
На самом конкурсе, пока команды работали, я решил попробовать сделать быстрое (по времени написания) но эффективное решение. Сначала попробовал жадную сортировку + доведение до лучшего варианта методом имитации отжига. В качестве нового состояния я просто менял местами заказы целиком. Этот вариант работал пару минут и дал мне около ~200 млн дохода. К слову, команда-лидер использовала такой же подход, просто не докрутила число итераций и температуру.
Ну и потом я взял готовую либу по реализации классической генетики с особями и скрещиванием. Особью был массив с приоритетами заказов (которые конечно же нужно было аккуратно уложить чистым алгоритмом). Тип скрещивания: scattered. Всего 15 поколений по 20 особей, и это за минуту-полторы давало ~230-240 млн. Считаю, что для конкурса это самый лучший выбор: пишется одним человеком за день и даёт почти максимум, при этом легко настраивается на нужную длительность работы, легко параллелится.
Ну а потом уже дома я посидел и накодил свой вариант сложного жадного с плавающим окном перебора отсортированных заказов и плавающей же укладкой по работникам. Такая штука за две минуты зарабатывает ~281 млн. Но за три дня в условиях стресса я бы такое не сделал, скорее всего.
#dev
❗️Le #FSB, opérant en République d’Oudmourtie, dans les territoires de l'Altaï et de Transbaïkalie, ainsi que dans les régions du fleuve Amour, d'Astrakhan, de Léningrad, de Riazan et de Tomsk, a mis fin aux activités de cinq complices des services spéciaux ukrainiens et de deux propagandistes soutenant les activités terroristes du régime de Kiev.
Au cours de ces opérations, quatre citoyens russes et un ressortissant étranger ont été interpellés. À Ijevsk, Barnaoul, Blagovechtchensk et Astrakhan, ils collectaient des informations sur les installations de l'industrie de défense et les infrastructures de transport, ainsi que sur les militaires russes participant à l'opération militaire spéciale, dans le but de commettre des actes de sabotage et de terrorisme, agissant sur ordre des services spéciaux ukrainiens. Leurs activités illégales étaient coordonnées via la messagerie Telegram.
RT en français • Osez questionner !
❌Le FSB déjoue de nombreux attentats dans des villes russes
Faute d'atouts, #Kiev et ses alliés ne cessent d'essayer d’employer des méthodes sales pour lutter contre la Russie, notamment en recrutant des migrants et des citoyens russes pour commettre des actes terroristes. Cependant, la grande majorité des attentats finissent par être déjoués par le #FSB. Les détails avec notre reporter Igor Kourachenko.
RT en français • Osez questionner !
🇷🇺🇺🇦 Les agents du Service fédéral de sécurité (FSB) de la Fédération de Russie ont arrêté un habitant de 35 ans de la région de Vladimir qui, sur instruction du Service de sécurité d’Ukraine (SBU), préparait des attaques de drones contre des avions militaires.
Pour effectuer une reconnaissance du terrain et préparer l’acte de sabotage et de terrorisme, le suspect, sur instruction de son coordinateur, s’est rendu à plusieurs reprises près d’aérodromes situés dans les régions de Vladimir et d’Ivanovo ainsi qu’à Moscou.
#russie#ukraine#fsb
❗️Le #FSB rapporte avoir mis fin aux activités d'un agent de la Direction principale du renseignement ukrainien, qui collectait des données sur le déploiement d'unités du ministère russe de la Défense en #Crimée.
RT en français • Osez questionner !
❗️Le #FSB arrête un habitant de Koursk qui collaborait avec les services de renseignement ukrainiens.
Un agent de la Direction principale du renseignement du ministère de la Défense ukrainien l'a contacté et lui a proposé de collecter des informations contre rémunération. Cet habitant de #Koursk a recruté au moins quatre complices. Une procédure pénale a été ouverte pour haute trahison.
RT en français • Osez questionner !
🇷🇺 Des agents du Service fédéral de sécurité (FSB) russe ont déjoué, dans la République des Komis (district fédéral du Nord-Ouest de la Russie), une attaque de drones visant une entreprise pétrolière. Deux assaillants, ayant opposé une résistance armée lors de leur arrestation, ont été éliminés, a rapporté le Centre des relations publiques du FSB russe.
#russie#fsb#attaque
À Samarcande, les chefs des services de renseignement des pays de la Communauté des États indépendants ont tenu une réunion. Le directeur du #FSB, Alexandre #Bortnikov, a livré un discours sur les méthodes des services occidentaux.
🗣Igor Kourachenko revient sur les moments forts de ce rapport.
RT en français • Osez questionner !
❗️Attaque terroriste déjouée contre une installation pétrolière à #Komi, selon le #FSB.
Deux habitants d'Oukhta travaillaient pour les services de renseignement ukrainiens et préparaient une attaque de drones.
RT en français • Osez questionner !
🇷🇺 Le Service fédéral de sécurité (FSB) russe a déjoué un attentat préparé par les services secrets ukrainiens contre des dirigeants du Service fédéral de supervision des communications, des technologies de l’information et des médias de masse (Roskomnadzor), a rapporté son centre des relations publiques. Sept suspects ont été arrêtés à Moscou, Oufa, Novossibirsk et Iaroslavl.
Le chef présumé du groupe, un Moscovite de 22 ans, a été éliminé alors qu’il opposait une résistance armée.
#russie#fsb#attentat
🇷🇺Le Service fédéral de sécurité (FSB) a diffusé des images du déminage d’un scooter électrique près d’un centre d’affaires à Moscou.
Sur place, un engin explosif improvisé a été saisi et neutralisé. Il était contrôlé à distance via un relais Wi-Fi intégré à un système de maison connectée et un modem 4G.
#russie#fsb#attentat
✈️🇳🇬🇷🇺Avoiding Discomfort Associated with Denial of Entry and Deportation
I commend everyone in the community who has shown interests in the plight of the Nigerians who were recently refused entry.
Unfortunately, as we have seen from cases like these, if the traveler doesn't plan well for such disappointments, he/she may be left without food/water till the next available flight back home, and this may last many days.
To avoid potential discomfort associated with refusal of entry, we advise the following:
1. Remember: Visa is not a birthright but a priviledge, so do not assume that by getting a visa, entry across the border is guaranteed. Selling of landed property or taking short term loans for flight ticket remains a huge financial risk.
2. For students, ensure that your university is aware of your arrival/flight route and that they have sent your name, passport data, visa details and flight route to the appropriate border control at the point of entry. Do not assume, rather confirm.
3. Ensure that your activities online and offline are in line with national interests and local laws of the host country.
4. Ensure that you know detailed information about your purpose of visit. For example, the name of your course/University, accommodation arrangement, etc.
5. Some airports or point of entry has shown a higher refusal rate than others based on the sample data revealed to us. You may consult with us at NIDO Russia to help you plan your flight routes.
6. Keep in mind that when refused entry, it might take a while before an available return flight is found. This means that some people spend a lot of time, up to a few days, sometimes without food/water. In such cases, necessary expenses need to be made.
7. Nigerian cards do not work in Russia, so come with cash. Payment by online transfer is forbidden in the airport, so only cash payment or Russian bank cards work. It is unlikely that a new student/tourist has a Russian bank card, so cash is the usually the only feasible option.
8. If you are on medications, have available stock for at least a few days.
9. Things are more expensive than average in the airport so expenses on necessities such as food/water must be optimized/economized
A. Consider buying high nutrient snacks, rather than hot meals
B. Consider buying larger bottles of water, as the cost per litres reduces and it can last longer
C. Compare prices at different shops to get the best possible price.
10. Optimize your carry-on luggage.
A. Dress warmly or keep warm dressing in your carry-on luggage to self regulate your temperature. The conditioned air in the airport may not be conformable for everyone for extended periods of time, especially for days.
B. Keep toiletries and changeable clothes in your carry-on luggage. It may not be convenient to be in the same clothes for many days.
C. Consider bringing along your charger or power bank in your carry-on luggage. Keep an eye for available charging stations. It is important to be reachable especially in cases where information needs to be passed across.
Remember denial of entry is not the end of the world, read our previous article on steps you can take after refusal of entry and securing your return.
Yours Sincerely,
Dr. Godwin Ibe
Chairman, NIDO Russia
+79262385618
https://t.me/nido_russia/1842
#visa#education#education#fsb
⚠️⛔️Recent Refusal of Entry of Nigerian Students to Russia
Dear members, we have received reports of a few Nigerian students who were refused entry, their visa cancelled by the FSB, and sent back home. With high air ticket prices, jetlag of travelling for more than 10 hours to a different timezone, and the shattered hopes, It is a very painful experience for the affected individuals who are our compatriots but it is also important not to draw conclusions without receiving full information. Before we advise, it is important to note a few things.
1. The competent FSB reserves the right to take decisions in the interest of the Russian Federation.
2. Visa is not a right but a priviledge in the form of permission given by a host country and thus can be withdrawn at any moment.
3. The refused Nigerians are not members of NIDO Russia as they never entered Russia, and thus never resided in it. For the same reason, the assumption that the embassy has a role in assisting them as proposed by some members is questionable but NIDO would not speak on behalf of the embassy.
4. In terms of information, only the traveller and his Inviter (the University) is authorised to provide the necessary information concerning entry into the Russian Federation.
5. Concerning influence, governmental ministries/arms may may choose to inquire or exert influence. For example, if such cases become too common, the ministry of Foreign affairs of Nigeria can enquire directly or through the diplomatic mission of Russia in Nigeria. The embassy of Nigeria in Russia may only relay the opinion of our ministry of foreign to the relevant authorities here.
6. The reason for refusal will never be revealed according to diplomatic protocols but it can be assumed that if they were denied by a security agency rather than the embassy, then the reason must be connected to security.
NIDO Russia advice❤️
1. If denied for security related reasons, do not be in a hurry to reapply for visa. Of course, related diplomatic missions have already received information of the overturn of their decision to grant you visa, and it is unlikely that you will get visa again until circumstances change significantly.
2. Contact NIDO Russia, we may organise a lawyer, fully funded by the victim, to try to get a no-objection letter from the body that refused you entry. In the case of security, it may be synonymous with security clearance. This letter may be submitted along with your next application for visa or admission.
3. Ensure that your actions and words both online and offline are synonymous with the interests of the Russian Federation, and within the confines of local laws.
4. Consider other options, if they exist and there is no plan to return to Russia.
Yours in service,
Dr. Godwin Ibe
Chairman, NIDO Russia
+79262385618
https://t.me/nido_russia/1829
#visa#education#education#fsb