I disclaim thee, o’ liability
USACO setup
USACO is fun. Though it is fairly easy to get up and running on the platform, there remain a few repetitive steps during problem solving that can be automated. Here is a brief summary of my automation steps:
- Use a template. Here is mine. Save it as template.cpp:
- Save this script as solve.sh in the same directory as above:
- All done!
Whenever you’re ready to begin coding a solution, simply execute
./solve.sh PROBLEM_NAME
All the best!
…Hello USACO
I love competitive programming. I love the anticipation while I wait with my fingers crossed after submitting a solution. And the rush that follows after getting an ‘AC’.
After stagnating near the 60-70th percentile for eons, I have decided to dedicate focused practice time for competitive programming. The next series of blog posts will track my journey through USACO.
All the best to me!
…Facebook Hacker Cup 2015 Qualification Round Solutions
Facebook recently organized the qualification round of Hacker Cup 2015. They posed some interesting problems and anyone who could get at least one problem right can move to the next round.
I managed to get a rank of 217, with a perfect score of 100. I have posted my solutions below with a little bit of commentary. You can access the problems here.
Cooking the Books (15 points)
This was the easiest question. Since the constraints were so small, it suffices to use brute force and try all possible swaps. Care has to be taken however to make sure that a number never starts with 0.
…