acm-icpc

Where can you find fun/educational programming challenges?

I've searched around for different challenge sites, and most of them seem to be geared towards difficulty in problem solving logically, rather than trying to use your language of choice to do something you haven't used it for. Their center is around mathematics rather than function design. Some kind of point system for correctly solvin...

How to prepare for a programming competition? Graphs, Stacks, Trees, oh my!

Last semester I attended ACM's (Association for Computing Machinery) bi-annual programming competition at a local University. My University sent 2 teams of 3 people and we competed amongst other schools in the mid-west. We got our butts kicked. You are given a packet with about 11 problems (1 problem per page) and you have 4 hours t...

Have you found competitive programming to be useful?

I am looking to hone my programming skills outside of school/work and was wondering if any of you have participated in competitive arenas like CoreWar or TopCoder strictly for the purpose of self-improvement. If so, have you found them to be worthwhile and are there any other similar 'games' out there which merit mentioning? ...

ACM Problem: Coin-Flipping, help me identify the type of problem this is.

I'm practicing for the upcoming ACM programming competition in a week and I've gotten stumped on this programming problem. The problem is as follows: You have a puzzle consisting of a square grid of size 4. Each grid square holds a single coin; each coin is showing either heads (H) and tails (T). One such puzzle is shown here: H...

return 0 implicit

The last week on the ACM ICPC Mexico competition, I missed a "return 0" on a C++ program. For this reason we got punished with 20 minutes. I had read that the standard does not oblige us to write it at the end of a main function. It is implicit, isn't it? How can I prove it? We were using a Fedora system with a G++ compiler. ...

What are good programming competitions?

I'm interested in both single coder and team competitions. ...

Learning Algorithms: Never getting any better

I want to implement algorithms and data structures for practice. I have a bunch of textbooks I am working through and although I can understand the idea and theories I can never seem to close the book and implement working code on my own, like people do in ACM programming contests. I can learn how to write a linked list in C, and forget...

How does the ACM ICPC Online Judge prevent malicious attacks?

I've spent more than a few hours humbling myself on the ACM ICPC's problem set archive, and I've wondered how the online judge is able to compile and run source code from any user and prevent malicious attacks to their system. Are the compiled binaries run from some kind of limited sandbox? How would one go about setting up this kind o...

I need some tips on how to prepare for the ICPC Programming Competition!

I'm participating in the Competencia Latinoamericana de Programacion this month and I was wondering if any of you have ever programmed competitively. The contest is basically 10 questions and I have to design an algorithm for each question with a team of 2 other people. What are some things I should be ready for? What exercises should ...

std::pair<int, int> vs struct with two int's

In an ACM example, I had to build a big table for dynamic programming. I had to store two integers in each cell, so I decided to go for a std::pair<int, int>. However, allocating a huge array of them took 1.5 seconds: std::pair<int, int> table[1001][1001]; Afterwards, I have changed this code to struct Cell { int first; int s...

CodeGolf: Brothers

Hi guys, I just finished participating in the 2009 ACM ICPC Programming Conest in the Latinamerican Finals. These questions were for Brazil, Bolivia, Chile, etc. My team and I could only finish two questions out of the eleven (not bad I think for the first try). Here's one we could finish. I'm curious to seeing any variations to the co...

Can you answer this 2009 ACM International Collegiate Programming Contest Finals problem?

Out of curiosity, I was checking out the problem set to the 2009 ACM international collegiate programming contest. The questions are pretty interesting. They're available at http://cm.baylor.edu/resources/pdf/2009Problems.pdf. I could not come up with an algorithm that solved problem 1, which I will reproduce here. It set off a livel...

C++ Programming Contests

I would like to test my C++ programming skill level by competing with others. What programming contests are there for C++? ...

interactive tasks (question to participants of acm,ioi etc) - realization.

You well know tasks in olympiads, where solution's input is output of same module. Server.exe's output is Client.exe's input, and in another direction. How do you think it's testing under Windows? I try to made personal testing system. More formally: You have: 1) a.exe and b.exe 2) stdout of a.exe is stdin of b.exe and in another direct...

being able to solve google code jam problem sets

This is not a homework question, but rather my intention to know if this is what it takes to learn programming. I keep loggin into TopCoder not to actually participate but to get the basic understand of how the problems are solved. But to my knowledge I don't understand what the problem is and how to translate the problem into an algorit...

Read and parse line in C/C++; put tokens in an array or vector or similar structure

Hello everyone, I have to submit code to one of the problems in ACM IPC and, as you may know, the time counts a lot. So, I have to read efficiently an input like this: The first line will contain the sequence of integer values associated and the second line will contain the sequence of integer values associated with another sequence. E...

Solution to 2010 ACM Problem: Castles

Post your best solutions! You can find the full problem description and examples here: ACM 2010 problems (pdf) You have a set of castles connected by roads, and you want to conquer all the castles with the minimum number of soldiers. Each castle has three properties: the minimum number of soldiers required to take it, the number of sold...

Where can I find a forum/discussion board for competitive programming? (ACM, TopCoder etc)

Hello, I'm trying to prepare for the ACM competition in November, and I'm going through the practice problems and getting stuck on data structure or implementation problems. I tried to find a discussion board or forum for discussing these types of problems, but I couldn't find one in about thirty minutes of Web searching. Is there a f...

Do programmers should train in ACM-contests?

A lot of those coders, who are succeed contests like TopCoder SRMs, or Google Codejam, etc., get good jobs and salary. But is it really neccesary? I mean, do all code developers should know different algorithms, structures, or all this contests are just wasting of time? The problem is those contests take much time - to train, to study, t...

Optimizing a 2 parameter distance function on line segments (ACM ICPC Regionals Elim.)

This problem is a subproblem of a problem posed in the ACM ICPC Kanpur Regionals Elimination Round: Given 2 line segments bounded by the 2D points (Pa, Pb) and (Pc, Pd) respectively, find p and q (in the range [0,1]) that minimizes the function f(p, q) = D(Px, Pa) + D(Py, Pd) + k D(Px, Py) where 2 <= k...