SuprDewd's blog

By SuprDewd, history, 4 years ago, In English

NWERC 2020 was finally held this last weekend after a few month delay due to the pandemic. The format was a little different this time around, with each contestant participating from home (i.e. three computers per team) and having full read access to the internet during the contest.

We wanted to let you know that this Saturday at 12:00 GMT we will be hosting an open version of the contest on Kattis: https://open.kattis.com/contests/nwerc2020open

The problemset, solution slides, testdata and judges' solutions are already available on our website, but we ask that you please refrain from looking at them until the open contest is over. Good luck, and we hope you enjoy the problems!

Full text and comments »

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

By SuprDewd, 7 years ago, In English

KTH Challenge is an annual individual competition hosted by the KTH Royal Institute of Technology in Stockholm, Sweden. The 2017 edition starts tomorrow at 8:00 GMT, and will be 4 hours long. You can follow the local contest here, or compete at the online mirror.

For problems from previous years, see the contest website.

Full text and comments »

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

By SuprDewd, 8 years ago, In English

A couple of years ago Google launched an interesting website: Google Foobar. If you try to log in, you'll get an error saying:

To login, you have to have logged in before. Confused? Search on...

Pretty mysterious, right? Well, from what I read on Hacker News at the time, this is some kind of a puzzle set up by Google to recruit Python and Java developers. To get in, you'd simply have to search for the correct phrase. Someone reported that searching for "arraylist java" got him inside, but that didn't work for me.

However, I recently found that searching for this actually gets you inside, but you have to be a little bit patient. Here's what you can do:

  1. Open a browser of your choice (it has to be a sufficiently new version so you get the newest version of Google). I've only tested this successfully with Chrome and Firefox.

  2. Go to https://google.com/ncr. (The /ncr at the end is to make sure you go to the main version of Google. Don't know if that's necessary, but doesn't hurt)

  3. Search for "arraylist java" or "python list comprehension". Other programming-related search terms may also work, but these should definitely work.

  4. Here comes the "be a little bit patient" part. Copy the URL for the search results page that you just got (Ctrl+L, Ctrl+C). Now open a lot of tabs with the same URL (repeat Ctrl+T, Ctrl+V, Enter). I'm not sure how many tabs you need to open, but from my experience 10 tabs should be sufficient.

  5. Wait for each of the tabs to load. Then go through them, one by one, and look for a tab that contains a black banner saying "You're speaking our language. Up for a challenge?" at the top of the search results. (If you don't get any tab with this banner, try going back to step 1, possibly using a different browser.)

  6. Click "I want to play". You're in!

Now you will be presented with a terminal that you can use to solve some competitive programming-style problems using Java or Python. They start easy and become progressively harder, and each problem has a certain time frame you have to solve it within.

When you've progressed to the third or fourth level (don't remember which one), you get the opportunity to send your code to Google recruiters. From what I've read online, this has lead to some people getting an interview at Google. So if you're interested in that, this might be your chance! If not, it's still a bunch of fun problems to solve. :)

Full text and comments »

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

By SuprDewd, history, 8 years ago, In English

AlgoWiki logo

Hi everyone. Over the past couple of years I've been collecting problems, articles, and competitive programming resources that I find interesting. It's already grown to dozens of sheets in multiple Google Sheet documents, and is a pretty bad mess. As an effort to organize this list and make it public, I decided to turn it into an online wiki dedicated to competitive programming: AlgoWiki.

The url is wiki.algo.is, so it should be easy to remember.

I'm far from done migrating stuff into the wiki, but I think there's already quite a bit of useful information in there. I tried to prioritize algorithms/data structures/techniques that are less known, and then listed problems and articles that I thought were especially useful for learning/practicing the given topic. In some cases I've additionally extracted/written content about the given topic, with notes that point out common pitfalls or help give a better intuition for the topic.

To give you an example, consider the Minkowski sum page, a topic that I think is pretty neat, but has yet to become "mainstream" among competitive programmers (as far as I can tell). Here I've extracted relevant sections from Wikipedia, listed problems that can be solved using Minkowski sums, linked to comments/editorials that might give some hints for each problem, and given some links about Minkowski sums that I thought were useful. Ideally I would like to rewrite the text with competitive programming in mind, but the Wikipedia sections serve as filler content for now.

Now, while I hope you enjoy what I have gathered so far as well as what may be added in the future, I would also like to invite you to contribute whichever neat algorithms/data structures/techniques/problems/articles you may encounter, so that others may also benefit. This is a wiki after all... Currently there are two ways to contribute:

  1. by creating an account on AlgoWiki and editing pages through the web interface (as is common on online wikis), or
  2. by forking AlgoWiki on Github, where all the wiki source files are stored.

My goal is to keep the wiki as open as possible, while also keeping the quality of the content high. If you want to help me moderate contributions, feel free to get in touch.

I also have another related project in the works, which is at an even earlier stage of development. The motivation for that project is that great problem sets, articles, and other competitive programming resources, especially older ones, are slowly disappearing from the internet. Another case in point: the link to the third problem on the Minkowski sum page linked to above is already dead. As a digital data hoarder with much respect for the effort that went into developing these resources, that makes me very sad. To battle that, I would like to create an archive/mirror of competitive programming resources.

I already have something very primitive up and running at archive.algo.is, with some content that I've scraped online. As this is very early stage (and this applies to the wiki as well), I have not yet gone through licenses/contacted rights owners, so if there is anything there that I may not be allowed to redistribute, please let me know.

I also have a lot of other material, both digital (e.g. training camp material) and on paper (e.g. "vintage" problem sets from CMU around 2000), that I would love to make available online, given an approval from the respective sources.

The ultimate goal would then be a vast, yet well organized collection of problem sets (with test data), and other kinds of competitive programming resources, reliably mirrored over several machines on the internet. In particular, this could then be used by the wiki without fear that the links eventually die.

If you would like to help me get this started, or have any material you can contribute to this, please, also get in touch.

Full text and comments »

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

By SuprDewd, history, 8 years ago, In English

I have a few competitive programming stories that I've been meaning to write up on my "blog". I just finished the first one about my favorite bug. I hope you'll enjoy it.

(I also posted it on reddit in case you'd like to help me fend off lousy comments about competitive programming, or perhaps give me an upvote.)

I'd also like to encourage others with [interesting|funny|sad] competitive programming-related (horror)? stories to do the same. Either post a comment here, make your own post on Codeforces, or post it to your personal blog. I've already seen multiple such stories here on Codeforces, all of which I enjoyed, and I'm sure there are many more in hiding!

Full text and comments »

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

By SuprDewd, history, 8 years ago, In English

The 2016 ACM-ICPC North America Qualification Contest will be held tomorrow, Saturday, at 16:00 UTC. The duration is 5 hours.

There will be a simultaneous open contest, held on Kattis.

For approximate difficulty, you can find the 2015 problem set here.

Full text and comments »

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

By SuprDewd, history, 8 years ago, In English

The 2016 Google Code Jam World Finals just started. Relevant links:

Edit: The contest is over. Results:

  1. tourist
  2. kevinsogo
  3. Egor
  4. eatmore
  5. Merkurev
  6. mnbvmar
  7. scott_wu
  8. simonlindholm
  9. gs12117
  10. semiexp
  11. ffao
  12. vepifanov
  13. pashka
  14. KAN
  15. rng_58
  16. yosupo
  17. Xhark
  18. Nore
  19. Marcin_smu
  20. s-quark
  21. jcvb
  22. nika
  23. xllend3

Congratulations!

Full text and comments »

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

By SuprDewd, history, 9 years ago, In English

Hi everyone. Starting next week we will be teaching our course about competitive programming at Reykjavík University in Iceland for the second time. The course lasts for three weeks, and we will post a new problem set and lecture material daily on this page so you can follow along from home.

The format of the course will be very similar to the last edition, although we'll try to bring in fresh problems for the problem sets. We would still like to get feedback from the community about the previous edition if there's anything that may be missing from the lectures or could be improved. Thanks again for all the nice messages I've received after posting the previous edition, and I hope you'll enjoy this edition as well.

Full text and comments »

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

By SuprDewd, 10 years ago, In English

My teammate and I held a competitive programming course at Reykjavík University in Iceland. Even though our students are Icelandic, we decided to have all material in English so we could share the course with you guys. So now we have published the slides, including LaTeX sources, the problem sets, and all supporting material. All of this can be found here.

Most of the material has a pretty open license, so you're free to do almost whatever you want with it. We hope you enjoy the material, and any suggestions for future iterations of the course are welcomed.

Full text and comments »

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

By SuprDewd, 10 years ago, In English

Hi everyone.

Just wanted to let you know that the 2014 ACM ICPC World Finals problemset will be available on icpc.kattis.com shortly after the contest starts tomorrow. You will be able to submit solutions just as if you were on the contest floor in Ekaterinburg.

Have fun!

Full text and comments »

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

By SuprDewd, 11 years ago, In English

Hey guys. I wanted to share a neat trick regarding the Team Contest Reference (TCR) that we're allowed to bring to ICPC contests, for example. I got the idea after spending many minutes debugging a Convex Hull implementation I wrote directly from my TCR in the middle of a regional contest. I knew the implementation in the TCR was correct, but I had probably made a typo somewhere in the code when I was inputting it, but it was impossible to find.

The idea is to store hashes of the code in the TCR. For example, for each code snippet in the TCR we could store its MD5 sum. Then after typing up some snippet from the TCR, we can check that the MD5 sum of the file matches the MD5 sum in the TCR. This is however not very beneficial, since we can only check whether or not our code is identical. We don't get any information about where the error was made.

Another idea is to store the MD5 sum of each line of each code snippet in the TCR. This can take up much space, but the first couple of characters from the MD5 sum should be enough. After typing up a code snippet, we can go through each line and check that the MD5 sum matches, allowing us to easily find the line where the input error was made. When the code snippet has many lines, this will take a long time, and is therefore not practical either.

A much better idea is to do the following. After the ith line of the code we store the MD5 sum of the first i lines of the code. Then the last line contains the MD5 sum of the whole file, which can be used for quickly checking if all the code is identical. If it isn't, we can use binary search to find the first input error in our code. That is, we first compute the MD5 sum of the first half of the lines of the code and check if it matches the corresponding MD5 sum in the TCR. If it doesn't, then the input error was made in the first half of the code. Otherwise, it was made in the second half of the code. We do this again until we narrow the range down to the one line where the first input error occurred.

I've used this in a contest and it was really helpful. Just being able to validate that the code is correct gives you much more confidence, but being able to quickly locate the error can be a real timesaver. I use Vim, so the workflow I use is to visually select the lines that I want to check, then execute the following in command mode:

:'<,'>w !sed 's/\s*//g' | md5sum

Notice that I ignore all whitespace when computing the MD5 sum (the same has to be done in the TCR). With this in the command history and using the 'gv' shortcut to reselect previous selection, it takes no time to locate the input errors, even in long snippets.

I have this in my TCR, which you can find here.

Full text and comments »

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

By SuprDewd, 11 years ago, In English

The Northwestern European Regional Contest will be held this sunday. An online contest will be held alongside the onsite contest. Registration and more details can be found on the NWERC site.

Are there any Codeforces members who will be taking part in the onsite contest in Delft?

Full text and comments »

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

By SuprDewd, 12 years ago, In English

"The current UVa Online Judge platform is almost 7 years old. It calls for a well deserved retirement. Help us bringing UVa OJ to today's web."

Miguel Revilla and the UVa OJ team are planning to upgrade the UVa OJ! That means building the platform from scratch, and to do that, they need financial support. I think this website means a lot to many people in the competitive programming community, and so I think we should do our best to support them.

Here is a link to the fundraiser:

http://igg.me/at/newuvaoj

And of course, the UVa OJ website:

http://uva.onlinejudge.org/

Full text and comments »

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

By SuprDewd, 12 years ago, In English

I'm looking for a training camp covering competitive programming this summer. Those that I've seen so far seem to be invite-only (i.e. USACO training camp and Petrozavodsk training camp), or taught in a language other than english.

So I was just wondering if anyone here knows of any such summer camp that is open for all and taught in english. I don't care where in the world it is held.

Also, does anyone know if Petrozavodsk training camp is taught in english or not? And it seemed to me that it was invite-only, but am I wrong?

Full text and comments »

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

By SuprDewd, 12 years ago, In English

The Northwestern European Regional Programming Contest 2012 was held today. The problem set is available on the NWERC site. Are there any Codeforces members who where onsite?

Full text and comments »

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