В общем, была задача на оптимизацию плана работ: есть набор заказов, и в каждом N тасков. Таски могут зависеть друг от друга или нет, имеют длительность и тип. Ещё есть M работников, каждый из которых может выполнять таски только определённых типов, причём, у каждого своя скорость.
Если все таски в заказе выполнены, фирма получает сколько-то денег. У заказа есть дедлайн, за просрочку штраф (за каждый день просрочки), который вычитается из цены заказа. И ещё фирма тратит деньги за каждый день своей работы независимо от того, как загружены её сотрудники (то есть просто платит зарплаты по сути). Ещё важен учёт праздников и выходных.
Нужно заработать на определённом наборе заказов и работников как можно больше денег. Полный текст задачи и код программы проверки есть в репозитории. Эта задача является изменённым заказом, который мы с напарником решали в реальной жизни: оптимизация работы печатных станков для типографии. Правда, тогда и мы справились так себе, и заказчик в итоге сначала захотел всё вручную сам делать, а потом и вовсе похоронил проект при смене директора.
!!! Не читайте дальше, если хотите сначала попробовать решить самостоятельно, потому что я сейчас опишу эффективные подходы и результаты.
________________________________________
Так вот. Мы с другим экспертом Андреем сразу сели и написали разные варианты, чтобы задать шкалу, по которой будем оценивать решения команд. За пару часов я собрал примитивный жадный алгоритм, который сортировал заказы по прибыльности и укладывал в сетку кое-как, это дало нам нижнюю оценку. Мой алгоритм заработал ~75 млн виртуальных рублей, мы решили для оценки поставить нижней границей 40 млн. То есть всё, что ещё ниже, оценивалось в ноль баллов за качество оптимизации.
Затем Андрей закрылся дома на три дня и вышел на свет со сложным жадным алгоритмом, который очень хитро сортировал заказы и очень хитро укладывал их в сетку, попутно выбирая разные способы этой укладки в зависимости от конкретного заказа. Это позволило заработать ~275 млн рублей. Мы сделали верхней границей для оценки 280 млн.
К сожалению, в итоге только две команды из десяти прошли нижнюю границу, заработав, соответственно, ~91 и ~105 млн. К верхней границе не приблизился никто. И у четырёх команд алгоритм вообще не смог уложить без нарушений задачи в сетку (то есть, например, произвольно менял длительности, накладывал задачи друг на друга, давал одному работнику две задачи в один момент и так далее). Важной ошибкой команд, на мой взгляд, являлся тот факт, что никто не воспользовался возможностью запустить алгоритм на несколько минут и дать ему поработать. По условиям задания, можно было тянуть до 5 минут на одну оптимизацию, но по факту решения команд отрабатывали за единицы и десятки секунд.
На самом конкурсе, пока команды работали, я решил попробовать сделать быстрое (по времени написания) но эффективное решение. Сначала попробовал жадную сортировку + доведение до лучшего варианта методом имитации отжига. В качестве нового состояния я просто менял местами заказы целиком. Этот вариант работал пару минут и дал мне около ~200 млн дохода. К слову, команда-лидер использовала такой же подход, просто не докрутила число итераций и температуру.
Ну и потом я взял готовую либу по реализации классической генетики с особями и скрещиванием. Особью был массив с приоритетами заказов (которые конечно же нужно было аккуратно уложить чистым алгоритмом). Тип скрещивания: scattered. Всего 15 поколений по 20 особей, и это за минуту-полторы давало ~230-240 млн. Считаю, что для конкурса это самый лучший выбор: пишется одним человеком за день и даёт почти максимум, при этом легко настраивается на нужную длительность работы, легко параллелится.
Ну а потом уже дома я посидел и накодил свой вариант сложного жадного с плавающим окном перебора отсортированных заказов и плавающей же укладкой по работникам. Такая штука за две минуты зарабатывает ~281 млн. Но за три дня в условиях стресса я бы такое не сделал, скорее всего.
#dev
Trending Apps: Bombie Airdrop Announcement
#Bombie#airdrop
Trending Apps highlights a hint from Bombie about their upcoming TGE and $BOMBIE airdrop. Followers can also receive an exclusive starter bonus in-game to catch up with experienced players. Visit the Apps Center for more upcoming airdrops.
Source: link
@tonlines
🪙 Bombie’s FINAL Event – Get ready for Airdrop!
Bombie is crushing Web2 games with a record-breaking $80 ARPPU, surpassing League of Legends and Overwatch! 9.64M players have already joined since August 2024.
Now, it's your last opportunity to claim 🪙 $Bombie AIRDROPS! The Bombie Bonanza event rewards you just for showing up!
🎁Bonus Tickets for past supporters
🪙Daily Free $Bombie
😀Prize pool distributed every 3 days
🙎♂️Don't miss out – this is Bombie’s FINAL event! Get in now and secure your rewards before it’s too late!
#Bombie#Airdrop#Web3#TON
⚡️Trending Apps Weekly Highlights: Win NFTs and Discover Web3 Opportunities
#NFTs#Bombie
Trending Apps covers exciting updates, including a chance to win exclusive NFTs through the Gatto x Doge Pound partnership and insights into new Web3 projects. Subscribers can also look forward to AMA sessions and Bombie’s $BOMBIE airdrop. Explore features from the dTON ecosystem and participate in secure BroBot Contests for additional prizes.
Source: link
@tonlines
Trending Apps: Explore Stylish Zombie Slaying in Bombie
#BOMBIE#RPG
Trending Apps introduces Bombie, a unique RPG where players can stylishly eliminate zombie hordes while earning $BOMBIE rewards. The game also offers PvP arenas and character customization, providing endless entertainment and challenges.
Source: link
@tonlines
Trading $BOMB starts in 50 min on BingX
Join here ➡️create your BingX account
There were no pre-deposits on BingX, so don’t worry — all assets are still on hold for at least the next two hours.
Let's see what the rate will be🔥
bingx.com/en/spot/BOMBUSDT/
#Bombie#Listing#Airdrop
⚡️Catizen Announcement: Animoca Invests in Catizen for Web3 Gaming Expansion
#Telegram#Bombie#Animoca
Animoca Brands has made a major investment in Catizen, a popular Telegram-based game with nearly 50 million players. With a significant community, Catizen is set to host the Bombie airdrop on May 20, 2025, expected to be one of the largest token generation events of the year.
Source: link
@tonlines
🙎♂️Bombie:Durov Server Blasts Off! ⚡️
🔥Two Servers, One Epic Adventure: Welcome to Durov, Bombers!
🫡 Get in on the Ground Floor: the early bird catches the worm, and in this case, the early #Bombers catch the 🪙#Bombie!
Join now for the juiciest rewards❤️
The Daily & Weekly $Bombie Reward Preview of S2.Durov is as follows:
Rank in Arena: Daily & Weekly Rewards
Rank1: 1,000,000 & 5,000,000
Rank2: 600,000 & 3,000,000
Rank3: 400,000 & 2,000,000
Rank4: 300,000 & 1,500,000
Rank5: 250,000 & 1,250,000
Rank6-10: 200,000 & 1,000,000
Rank11-20: 120,000 & 600,000
Rank21-50: 80,000 & 400,000
Rank51-100: 50,000 & 250,000
Rank101-200: 20,000 & 100,000
Rank201-500: 10,000 & 50,000
Rank501-2000: 5,000 & 25,000
Rank2001-10000: 2,000 &10,000
Rank10001-50000: 1,000 & 5,000
Rank50001-150000: 500 & 2,500
The sooner you dive in, the more 🪙 $Bombie you'll rack up. Don't wait, the party has started!
It's a good chance to all newcomers! 🎁
Kill Zombies, Earn $Bombie!🪙
🏆Gather Round, BOMBERS!
🙎♂️For all Bombers, the journey is still long, and there are many zombies we need to defeat to earn $BOMBIE tokens
As fellow Bombers, we will share tips on efficiently fighting the zombie invasion. However, you must be Bombers who are always ready to battle zombies every day!
The path you must take:
🔴Log in every day to claim daily rewards.
🔴Open airdrop boxes and upgrade your weapons!
🔴Acquire high-power skills.
🔴Climb the rankings — the higher your rank, the more $BOMBIE tokens you can earn daily and weekly.
🔴Always maximize your PK tickets (1 ticket every hour) and aim for the highest rank.
🔴 You can use in-game Bitcoin to purchase airdrop boxes, PK tickets, and skill tickets in the shop menu. This is incredibly useful for Bombers who want to gain power quickly!
🎁Get VIP Privileges
🔫Monthly Card (30 Days):
✅500 in-game Bitcoins x1
✅100 airdrop boxes every day
✅Faster airdrop box opening
🔫Seasonal Card (90 Days):
✅3,000 in-game Bitcoins x1
✅100 in-game Bitcoins and 100 airdrop boxes every day
✅PK ticket limit +10
✅Extra 20% EXP for opening 1,000 airdrop boxes daily
🎰Always maximize events
You can instantly earn 20K Bombie tokens and 500 in-game Bitcoins using LUCKY SLOT! (Complete all tasks to get more spins)
Those are our tips for all Bombers! We hope you achieve what you desire and always succeed in defeating the zombies!
Upgrade your weapons, kill zombies and earn $BOMBIE!🪙
#Bombie#Bombers
💣Countdown: 2️⃣ days until TGE $BOMB!
Bombie is already on the home stretch — the TGE of the $BOMB token will take place in a week.
🕓 The timer has started. Those who played are already closer to the awards. Those who just connected will still have time! The community is waiting for the most important event of this year!
According to BlockBeats, on May 12, Bombie surpassed 12 million total users across both Telegram and Line, making it the world's largest Web3 game.
🙎♂️Keep playing!
#Bombie#TGE#Web3#Airdrop
⚡️Catizen Announcement: Claim Your CATI Reward Now!
#CATI#Cattea#Bombie
Catizen Announcement reveals details about the S2 CATI token airdrop for participants of their game. Additional 890K CATI tokens have been added, making the total supply 10,890,000. The claiming period is open for two weeks, with rewards delivered directly to game accounts.
Source: link
@tonlines
🙎♂️Bombie Airdrop is Closer Than Ever🪙
Yesterday, a video was released on the game's official channel, saying that the game has become the leader in terms of payment per player in the #Web3 sphere and not only, the team's plans include: reincarnation of #Bombie in a new genre and creation of a series of games on the #Catizen platform.
The community is also offered to stake earned $Bombie to receive income from other games. This means that #TGE and airdrop are very close — in the X project they niticed that it is might be April 2025🔥
Another season is also coming to an end 🎁Airdrop Pass S2, if you bought it — collect the last rewards before the drop. And in the version 📱Bombie Line offers a 10% discount on all purchases from April 9 to 30.
🏆We are at the finish line — one last push remains!
⚡️Catizen Announcement: Airdrop Rewards Update
#AirdropPass#Cattea#Bombie
Catizen Announcement has completed the reward calculation for the Airdrop Pass S2. Rewards, including $Cattea and $Bombie, will be available for claim on May 7th and sent directly to the game accounts.
Source: link
@tonlines