Laggy's blog

By Laggy, history, 2 months ago, In English,

 Problem: 467C - Юра и работа So as you can see this is so cool because the bug doesn't actually have anything to do with the solving function. It happens somewhere when building the prefix sum. The current code doesn't pass TC#5 while after removing the green part it goes up to TC#55. How? I wish I knew. Maybe you guys have some thoughts ^^

Kudos to BasselBakr for playing with it.

Read more »

Tags bug, op
  • Vote: I like it  
  • +7
  • Vote: I do not like it  

By Laggy, history, 6 months ago, In English,

CPC or Competitive Programming Community is a Discord server targeting problem solvers and competitive programmers from all backgrounds and different platforms.

First let me briefly introduce Discord for those who haven't heard of it before: Discord is an all-in-one voice and text chat application that works on browser/desktop/phone. Every server can have multiple text & voice channels accessed by members of the server or limited to a certain group of these members. You can share code/text/links/pictures at the text channels and you can talk in the voice channels.

So why join the server? Basically, you get to meet other members and have group discussions without caring about down-votes. The server is currently active with over 290 members (still have a long way to go). Also, Discord has nice features such as pinning messages/pinging users/search function and many other cool stuff.


 algo-chan is a bot I created to assign roles to new members. Roles? Yes, every member get to verify his identity using a command. This feature is exclusive to Codeforces right now. Depending on your Codeforces rating you get a role with different permissions and access to channels AND a different Color.

Currently, I am working on contest reminders and and algorithm/data-structure database. Soon you will be notified with upcoming contests of your choice and you will be able to lookup algorithm implementations using a special command: !algo


Role Colors:

Unrated, Newbie, Pupil, Specialist, Expert, Candidate master, Master, International Master, Grandmaster, International Grandmasters, Legendary Grandmasters just like on codeforces, each rank will have it's own color and special access to specific channels. You will get your role automatically after setting your handle using the above command.

Moderators: These are the most active users that are willing to help manage the server in case some user decided to spam/troll/post unwanted material.

This server is non-profit and is managed by the community. The bot is going to be open source when it's ready. What I ask of you is to join and help us build this amazing community.

Join us by visiting this invite:

Thank you all and I really hope to see you there.

Read more »

  • Vote: I like it  
  • +44
  • Vote: I do not like it  

By Laggy, 6 months ago, In English,

tl-dr version of the problem: You have a set of numbers and you need to look for a subset with a sum that ranges from l,u given that u — l is bigger than or equal the difference between the max,min elements from the set of given numbers.

Why does the two pointer method work here? Sorting the numbers and just adding the elements until you get over the range boundaries then subtracting until you get it right (in case there's a solution this will always work), why? What's the logic behind it?

Read more »

  • Vote: I like it  
  • +1
  • Vote: I do not like it