Take advantage of the holidays to review some of the major competitions that GCJ, ACM and TopCoder have taken over the years. The first is the memory of GCJ2006.
Google Code Jam 2006
Twists:
Google Code Jam 2006 is my first time in the United States to participate in the scene of the program design competition. Google Code Jam 2006 is located in New York, this time before the trip to New York, the visa is not a small problem, thank you very much for our concern, especially thanks to Wu (Wyy) and Lu Xiao help, so I finally embark on a trip to New York.
The flight time from Beijing to New York is 13.5 hours, because it is the first time to do more than 8 hours of aircraft, there is no necessary experience and preparation, the road is very tired. One to the hotel to sleep, the result because the phone ringtone time use is the eastern time, the difference is 12 hours, a feeling to all things even dinner together slept, casually eat something to continue to sleep. After all the live games I have developed the habit of early sleep to ensure adequate physical strength.
Race Process:
The spirit of the game is OK, but the allocation of the match room found himself and Tomek in a room, really very uncomfortable, in and next to Zhuzeyuan complained, found him and Petr a room, the same.
The following is the game process, the overall game process is more difficult than the imagination, but in fact, before the System Test results are very satisfied with the first simple description of the 3 questions it.
The topic of 250 points is a plane extremum problem, given n points, to find a straight line, so that n points to the line of the Y-direction intercept the sum of the smallest. I recall a very similar topic in the report of training team in 2003, remembering an important conclusion that the line must have gone through two points, although the topic was somewhat different, but quickly got the same important properties: The line must pass through two points. This makes it easy to get an O (n3) algorithm.
The topic of 500 points is a problem of anti-hash function, given a hash function and X, to find a minimum non-negative number y makes h=x. Estimate, one-way search needs 26^8, so I switched to bidirectional search, so it becomes 26^4. But the implementation process is much more complex than imagined, only about 280 after submission. In fact, this problem has a more simple mathematical method, the Tomek program has 450 +.
The topic of 1000 points is the problem of convolution function and computational inverse function, which is transformed into linear equation solving problem. At that time was affected by the atmosphere of the scene some nervous, wasted a lot of time, after the submission of about 550 points. In fact, some of the principles of the problem was not clear, but later and Ying (Wang Ying) after the discussion to verify that is correct.
Coding before the end of Petr, Tomek, Ying and Andrewzta have submitted 3 questions, of which Petr lead more, I and the remaining 3 people in the gap of 50 minutes or less.
After the start of the challenge phase, I was using a two-way search algorithm for the 500-point problem, not noticing that some one-way search for a linear equation was correct, and Cha was wrong 2 times within 10 minutes. Behind the above 4 people, ranked fifth.
But the following 5 minutes have a dramatic scene, first of all Petr's 250 was Cha, and then Ying's 250 also was Cha, so I faced the situation: Tomek lead me 100+ points, andrewzta lead me in the first cent, because I and Tomek in a room, so I made a bold decision, is challenge Tomek 1000 points, I randomly generated a random big data, at the last moment submitted this challenge, the system returned a suffocating result: Successfully challenge. With these 50 points I went over Tomek and Andrewzta and took the top spot before System Test.
Dramatic results:
I was fortunate enough to be able to be so close to the championship when I first played in the field, which could be considered a perfect match if the System Test was able to Pass all the passes.
However, the whole story seems to have been deliberately designed, the result of System Test makes me dumbfounded: The first is 250 points of the topic, I because there is a place not in time to use double, and cause integer out of bounds; then, the 1000-point question is simply the highest state of tragedy, I did not in time in the Gaussian elimination of an important variable temporarily, resulting in the impact of the results, did not expect to have escaped so much big data, but not through the System Test. The final row is about 50. These two mistakes are still unforgettable.
Finally PETR won the championship, Ying Runner, Andrewzta because 500 hung up in 3rd.
November New York is a bit cold, I went with the brigade to the Empire State Building, the scenery is charming. The next day after a break with a few Chinese players for a while "find Friends", the first trip to the United States is over.
Summary:
The results of the game were not ideal, but I was quite acceptable for the first time in the world competition. Let's just leave some lessons for the next game.
In the Empire State Building to see everyone's shooting skills, I because of poor technology did not take any suitable photos.
In the course of the game, the first time to see the liympanda of the general demeanor, and panda together always laugh often open, he no matter what situation are fearless, this point I have been studying hard, but always do bad. But panda playing cards when it is not the same, always like to peek at other people's cards, but also show off that they will speak Cantonese, was Ying and rocking two Guangdong players mercilessly despised a.
PETR plus the previous TCO and after the TCCC, get a 2006-year Grand Slam, can be regarded as a historic breakthrough. Tomek some pity, than finished also asked me how cha he 1000 points, hehe.
In fact, this game Ying quite a pity, in fact Petr play is not very good, if Ying luck better, history from then will rewrite. But Ying still embodies his super-strong mathematical skills, let people admire. In addition, Lemontree, a colleague from Fudan Province, has also achieved good results.
This seems to be the last time I competed with Xreborner (because after Xreborner retired for a long time, forget GCJ2008 we meet again, thank you Savior reminder), thank you in my high school taught me a lot of programming skills, I have been in use so far.
Take advantage of the holidays to review some of the major competitions that GCJ, ACM and TopCoder have taken over the years. Yesterday is the memory of GCJ2006, earlier in the day, I still remember 3 years ago, I just participated in the ACM in the Beijing Division 2005 and Hangzhou Division 2005 situation.
2005 acm-icpc--ups and downs
I entered Tsinghua University to start undergraduate study time is August 2004, in Tsinghua University in the first year, because the basic course study is more tense, coupled with the computer system does not allow freshman students bring their own computer, I did not participate in the 2004 ACM competition. However, in the big one by one years did not stop this practice, the ACM is still enthusiastic.
Probably at the end of July 2005, together with the classmate Shell (Belle Fai) and Superzn (Zhang Ning) decided to join the ACM competition. For the team name does not have too many ideas, just take a dictionary order by the previous point of the bomber. In the course of the subsequent training, my programming state has been very good, the main way to train the game is: my main writing program, Shell and SUPERZN is responsible for translating topics, thinking algorithms and testing. This teaming pattern has been used in all the races behind us.
At the end of 2005, we enrolled in the 2005 Beijing Division and the Hangzhou competition. Successfully passed the preliminaries into the live finals. I remember when the Beijing Division in the preliminary, I and SUPERZN together in the Baidu Star Program design contest, the shell relies on a person's power over 6 questions, and finally the second qualification to participate in the Beijing Field competition.
Beijing Division:
The 2005 Beijing Division location is located in the next-door Peking University, because the traffic is very convenient, we did not live with most of the players, but also did not participate in Java-challenge and evening performances.
Before the practice game, speaking of the game position lottery, its own significance is not very big, but Wu teacher Magic RP two Tsinghua team pumped together, the results of the practice of half, and another Tsinghua team THU1 (players are: Wu Jingyue, Li Shi and King, as if later team name changed to Dreamcatcher, Not quite sure) was asked to change to a far-off place on the grounds that some schools felt it was unreasonable. Later, many of the division also appeared in the situation of team seats together, Wu Teacher's RP is not covered.
Remember to hang out with Fudan's Lemontree (Shengcheng) at the practice session, and the result was that he was asked to return to his seat in less than 10 minutes. There was the venue is a stadium, some teams to fly balloons after the balloon is floating under the ceiling, the general referee Li Wenwan teacher also threatened us that if the official game tomorrow to fly the balloon, it does not count through the corresponding topic, unless there is a way to take down the balloon.
Then there is the process of the game, the bottom lines below the text is what I found at that time left the game summary:
E: Quick Sort. 5 min 1Y.
I think 5 minutes can fight for the most recent ACM domestic division of the fastest record.
G: Two-point answer + minimum spanning tree. 25 min 1Y.
This is the classic optimal proportion spanning tree problem, we agree that this question is relatively simple. But was later criticized by Li Wenwan teacher, the argument is misleading other teams. However, when it comes to the optimal proportion spanning tree problem, TCO2006 time FWJ and Tomek unexpectedly have not seen this topic, this problem is originated from POI AH. I think the main reason we think the problem is simple is that we've all seen this on the winter camp, and if you see it for the first time, it may take some time to figure out the algorithm. In this case, the apology to the team that we affected, the final G was submitted more than 200 times, but only 8 teams AC.
C: The maximum matching of the binary graph. 42 min 1Y
The topic requires calculating the minimum cover set of a graph, and perhaps the only tricky is that the discovery graph is a binary graph.
D: Encountered a certain difficulty, found a is very simple, so first put
D is a relatively comprehensive topic, designing some simple computational geometry and string processing knowledge.
A: Simple geometry problem, there is a low-level error, submitted 3 times are WA.
A is the simplest topic in the Beijing division, my program has made a very low-level error, may also be the result of lack of experience.
D: Re-write, but did not consider a situation, WA 1 times.
87 minutes, Fudan's Abuacus over 4 questions occupy the RANK1. As a result of the team model, we stuck for 30 minutes with a lot of simple questions.
A:shell suddenly found a program in the low-level error, 105 minutes AC, recapture Rank1.
This is a very important step, and now if you do not have this discovery, the consequences may be disastrous.
B: Two-point answer +2sat. 129 minutes AC.
B is an obvious 2SAT problem, because the topic is relatively long, we did not find this simple problem very early.
D: The case of D was found without consideration, 140 minutes AC.
Looked at a board, at that time Abuacus, eccentric all only 4 questions, can in the first time to participate in the formal game to achieve 6-4 lead, then the mood is very excited, but because of lack of experience, also affected the next play. In fact, now in retrospect, this game is actually a good AK opportunity.
F:DP. The program is more complex, WA 4 times.
F is a complex dynamic programming topic, in fact WA's reason is a should use int64 place, we use int, this place is really difficult to find.
H:f temporarily unable to AC, had to turn work H. H is an ordinary simulation problem. Start without considering tanks and shells may meet in 1/3 seconds, WA 1 times.
There are one hours to seal the game.
H:shell found that tanks and shells could meet in 1/3 seconds, about 250 minutes AC.
For our team mode, when the main writing program player status is not good, it is easy to appear the situation of continuous card problem, this situation is not conducive to the normal play of the level. In the Beijing competition, we were fortunate not to have a continuous card place situation.
Remember, the Beijing division of the Judge semi-automatic, that is, if the result is AC, the speed will be very fast, otherwise due to human intervention, can not be AC submission often need to wait a while. After we submitted the 2nd time H, did not get a quick reply, thought already WA, so I and SUPERZN continue to test some data. But at this point, suddenly there is a mm from the left side of the balloon, this balloon has become the only blue balloon, the unexpected joy of the final achievement of the First district championship.
F: The following is painful to submit F, has been fighting to the last moment, WA 14 times, left the Beijing division the biggest regret.
At the last moment we seemed to have found the int64 mistake, but the idea was quite chaotic and failed to change. F's problem also led to no time to write I, at that time if directly rewrite the latter to Superzn to write F, can fully at the end of the game AC.
The general process of the game as mentioned above, the Magic balloon, I still remember the moment. Finally there are 4 teams to break 7 questions, Abacus composition should be Shengcheng, Timegreen and Suzhan bar, eccentric I only remember Sing, Zsu_panku I remember Savior (Chen Shi). The opportunity to meet the above-mentioned old friends is very few, and the district competition has become an important exchange opportunity for my old classmates.
My Acrush ID estimate is the beginning of the use of it, the blink of an eye has been more than 3 years.
Before and after the game, I always remember chatting with FAI teacher of Fudan University, and I can see his young figure in every game after that.
Now recalling the Beijing Division, it is fortunate to be the first to participate in the ACM formal competition to win the district championship. I think it is because the atmosphere of the scene for many teams have a small impact, then many teams are stuck in a few more cumbersome topics, the problem of algorithmic is not very strong. I've only just been in touch with TopCoder since then, and I'm sure I'll be better suited to this kind of game if I get older.
Hangzhou Division:
2005 ACM Hangzhou Division Competition held in Zhejiang University, Hangzhou division time in the Beijing Division after the end of the week, the first choice of Hangzhou division reason is very elegant: my own home in Hangzhou. In fact, I followed the team (at that time THU sent 3 teams to participate in the Hangzhou division competition, in addition to our team, b142857 (Hou Qiming), Zhy (Zhou Yuan), Ysy (Yang Siyu) team, another one by Wang Ding, Wang June and Huangyuan together arrived at Hangzhou station, immediately after the home rest, I didn't get back until before the game. During the week between Beijing and Hangzhou, I was in a state of decline, completely losing the atmosphere of the game at home and not feeling any more when I returned to the stadium. A tragedy is about to unfold. Let's take a look at the game, the bottom lines of the text is what I found at that time left the game summary:
G: First glance is simple, but debugging for 30 minutes without results.
G is a mathematical problem, in fact, "specific mathematics" book has a clear formula, but we use the recursive method should also be able to get the correct results. The program has made some low-level errors, because it is not in the state, debugging for 30 minutes have not found the error. There is also a problem of a team mode, in the later teaming mode, if like this does not think clearly the problem of the algorithm teammates are certainly not allowed me to write.
A: Simulation. 41 minutes AC, at that time certainly did not think this is the only 1Y topic.
A is a simulation problem, 1Y time is very late, the rankings are also very close.
C: graph theory. But because the stack escapes the RTE 5 times, it wastes a lot of time.
C's question about the tree ancestors concerned about the decision, the topic is very simple, the implementation of the method is also easy, is through the DFS to calculate. But we have overlooked a problem that has never been encountered: a stack overflow. Also, while the stack is running on the local machine, Eclipse provides a stack of around 8MB, so there is no overflow, but running in the post-commit environment overflows. And after each RTE, we've been trying to change the size of the array, and we haven't found the root cause. Debugging C at the same time, I also try to modify the G, the result G is also wrong 8 times more, and always WA.
I:shell in my depressed debug C and G AC, before WA once.
I was a dynamic programming problem, and WA might have overlooked some boundary conditions at a time.
D: Network flow, did not think first greedy to optimize. TLE 5 times eventually did not pass.
D is the calculation of the minimum cut, we prepared a first-stream propulsion algorithm, but according to the model of the problem, the first stream propulsion algorithm encountered the worst case: two-point diagram. Since Dinic was not very popular at that time, we have TLE 5 times has not yet passed.
Depressed to debug D and G.
E,b: All tried, but there was an unknown problem.
In the following time, D and G are constantly debugged, but never AC. Then try E and B, E can be processed by a segmented method, B is a mathematical problem. Normal words E and B are not very difficult topics, but it was already very confusing, even the sample did not pass.
In the end, we had only 3 questions, ranked 21, and experienced the most painful failure since I joined ACM. This failure is mainly attributed to my condition is too poor, basically what problems can not pass smoothly. Of course, the choice of the topic has a lot of problems: G is not a problem, but because of unknown reasons can not be passed, and then I put the program on the paper on the Zju on the AC, as for the site why not AC I still can not understand. If the choice of the first question directly affects our confidence, then the stack overflow of D completely disrupts our rhythm. For our teaming model, the card 2 has exceeded the limit, we can not try other topics.
Abacus also came to Hangzhou, their early embodiment of the strong advance advantage, in 2 hours to reach 6 questions; b142857 (Hou Qiming), Zhy (Zhou Yuan), Ysy (Yang Siyu) team behaved quite heroic, in the last hour beyond the Abacus, won the championship.
The failure of the Hangzhou division is still a painful memory in the heart, but this lesson is also a warning to my future study life.
Summary:
2005 was my first year in the ACM-ICPC competition, two ACM division, we experienced the excitement of winning the championship, but also experienced a look around waiting for the end of the game helpless. 2004 Tsinghua did not win any district Championship, 2005 Tsinghua played a beautiful turnaround, successively in Chengdu, Beijing and Hangzhou won the championship, but also three different teams.
The two divisions of G are legendary topics. Beijing Division, we 25 minutes 1Y of G, causing many teams to follow the failure of the follow-up, eventually reached 208 submitted 8AC low pass rate. However, in the Hangzhou division, G from the beginning of the game took up a lot of our time, until the end of the failure, it is estimated that at least a waste of about two hours. Really so-called into the G, defeated also in G.
After the Beijing division, POJ's forum was rumored to say I once said, "Get up and go to the toilet, don't touch the keyboard ... , I admire those students funny and nonsense, although we have set up a team mode with my main writing program, but also attaches great importance to the cooperation and everyone in the team important role.
At that time, Tsinghua did not organize the PK selection, chose the Chengdu Division of the championship team THU1 to participate in the global finals, then the final team is to refer to the results of the Second division of the decision, and now in retrospect is very reasonable. As we finally failed to get the chance to participate in the global finals, we were in low spirits for the next few months, and bomber announced the dissolution.
I saw a lot of old friends during the 2005 race. With FAI, the ACM contest can be seen as an intellectual game played by some old friends.
Take advantage of the holidays to review some of the major competitions that GCJ, ACM and TopCoder have taken over the years. After reviewing the GCJ2006 and 2005 ACM, turn to the TopCoder game. The earliest TopCoder tournament I attended was TCCC2006.
tccc2006--Death Group
TopCoder Collegiate Challenge (abbreviated TCCC) is a program design competition for school students around the world, held in the autumn in general, and held in Santiago for 2006 years in TopCoder. It takes about 11 hours to fly from Beijing to San Francisco, so it's not so tiring. Everything went well on the way, thanks to OpenGL's reminders, it's important for me to have slippers and pillows for more than 8 hours.
TCCC2006 used the standard TopCoder field game form, the competition has 48 contestants to participate, first 48 players were divided into 16 people a group, each group of semi-finals, the first 2 direct to the final, 3-6 to the wildcard competition, wildcard competition The top two of the 12 people filled the final 2 places, and the finals were attended by 8 contestants. An important innovation in TopCoder's live game is that each competitor has a synchronized display in front of the auditorium so that the viewer can see what the player does at any moment, greatly enhancing the interactivity.
TCCC2006 's Rooms 1 and later Final Round are the death groups. Now remember these two games.
1:
As for the allocation of 3 rooms, the TopCoder is distributed according to the Rating distribution of the runners at the registration deadline. But TCCC2006 's room power distribution is extremely uneven, I and the last champion Tomek, famous player Reid, Egor, Halyavin and Rating not high but strong Ying and ARDIANKP were divided into Room 1, pre-match Roo M 10% is recognized as the death of the group.
In Santiago, I and brother Macsy (Zhang Yifei) The same room, very grateful for the concern of senior brother, I had a good rest in those days. It is important to know that if a person has a time difference of about 10 hours, one must be careful not to affect the rest of the other person.
The next morning when I arrived in the United States, the player was allowed to prepare some necessary code 30 minutes before the arrival of the 1. But now we all prefer to learn Petr that line of code is not hit. Here is the process of the game:
250 points The topic is: given n (n<=50) integer AI and a threshold of D, computes n integers in all permutation PI to meet | The number of different possible AP1 in the Api-api+1|<=d arrangement. The most standard method of this problem is dynamic programming, the basic idea is to sort n integers, calculate two adjacent elements not more than D sequence. I used a more sophisticated algorithm to sort n integers, and for AI, if the AI could be the first element in the arrangement, then the AI must be contiguous in one Direction (size) and two elements per interval in the other direction. This algorithm is easier to implement, but the correctness proves to be more difficult, even let the person first feeling is wrong. I finished the program test all the samples are correctly submitted, 243 points. After submission I tested a lot of data and tried to prove correctness on paper.
After the game, I read the discussion record on the Internet. After I submitted a 250-point question, I was immediately questioned by Misof, who thought there was something wrong with my algorithm. According to Macsy seniors Memories, OpenGL in front of my screen to see me finish the program, also think my algorithm is wrong, but later they discussed found no counter-example.
After turning off the 250-point question, I just realized that room 1 's 3 scores were not 250-500-1000, but 250-600-900. Now it seems, for 250 more smooth situation, should do 500, if 250 is not smooth or want to surprise, can first open 1000 points. There was no experience at the time, I think 900:600 should be simpler, so it opened 900.
900 points The topic is: Given a n (n<=10) points with the right to a full graph (that is, N2 real numbers) and an attenuation coefficient p, a path through the D (d<=10) edge (no need to guarantee a simple path), the exponential attenuation length of the path is required (exponential attenuation refers to the length of paragraph I Times