wrong's blog

By wrong, 14 years ago, In English

I participated in TopCoder High School Round3(TCHS2010 Round3). This blog is in codeforces, but I have English blog only here. So I will write some reports of other competitions.


Easy(250)

Problem Summary

There is a rectangular grid which has size widthxheight. Starting in the top left cell, tracing the border of the grid in clockwise order, writing a string (phrase + "."). Then you are to calculate subsection of this grid which has its top left corner at (x1, y1), and its bottom right corner at (x2, y2).

Solution

It's easy to calculate what is the letter in position (x, y). So you can simply iterate x from x1 to x2, and y from y1 to y2.


Medium(550)

Problem Summary

There is a paper which a maze is written on both side. There is one start and one goal. You can fold and unfold the paper on vertical line. You are to calculate the minimum required steps to solve the maze. 

Solution

The solution is BFS. But implementation is too hard.


Hard(950)

Problem Summary

You have twoBricks bricks which have 2 units wide and 1 unit high, and threeBricks bricks which have 3 units wide and 1 unit high. Then you are to build perfect rectangle with your bricks. How many kinds can you make rectangles?

Solution

First, consider how many rectangle which has width W and height 1 can be made. If you know this value, the answer is sum of these values iterating W from 1 to 500000. And you can calculate this value with binary search.

Full text and comments »

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

By wrong, 14 years ago, In English

A. Shortest path of the king

It's easy problem. But because I was afraid to get WA, I implemented this problem in BFS. So I wasted time :(


B. Lorry

Because of my poor English ability, I wasted time in this problem to read problem description and understand it. Though I understood the meaning of this problem, I was confused by bugs. And I wasted time again.


C. Tic-tac-toe

I implemented brute-force algorithm to enumerate all valid game board. And then I implemented check of whether a player of either has just won. Then, I submitted the code.

When I was waiting for judge, I noticed that I had completely forgotten the case of "draw". So I got 1 WA :(


D. Least Cost Bracket Sequence

I couldn't solve this problem at the contest, and I can't still solve this problem now.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By wrong, 14 years ago, In English

Hello, I'm "wrong".

I'm high school student in Japan, and I'm 1716-year-old now. I decided to write this blog to write a report of competition and to learn English. I participate in some algorithm competitions(e.g., TopCoder, GCJ, and more). Now I'm studying algorithms to advance to IOI2010. I have my blog and twitter account(both written in Japanese).

If there are persons who want to advance to IOI2010, I hope to meet them :)

Full text and comments »

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