tom's blog

By tom, 9 years ago, In English

I'm reading following tutorial: http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=hungarianAlgorithm

Description of O(n4) algorithm doesn't seem to be clear for me. Why do we need add to edges (v, w) where ? Why n2 iterations is enough, since we add weight to 0-edges?

Full text and comments »

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

By tom, 9 years ago, In English
  • Vote: I like it
  • +1
  • Vote: I do not like it

By tom, 9 years ago, In English

Hello guys,

I'm working hard on my competetive programming skills for a couple of months, but I still find debugging problems as my main weakness. I waste huge chunk of time for looking for a bug (often much more time than for writing a code). Is there any way to improve this skill? Do you use some your techniques?

Thanks.

Full text and comments »

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

By tom, 9 years ago, In English

Hello guys,

2 days ago we've got Qualification on my University to National Championship Contest. And we had to face this problem:

Count all squares made by lines which are given by 2 points on input.

My solution: Store the map < pair<Line, distance between 2 collinear lines>, number of such pairs of lines> and for each pair of collinear lines (let's name one of them l) count distance between them and p = perpendicular line and add to the result map[p]*map[l]

But I'm getting WA for few hours.

My code: http://ideone.com/2ZhOzJ

Can anybody point me an error?

Full text and comments »

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

By tom, 10 years ago, In English

http://codeforces.com/gym/100460/problem/E

My idea for this problem is:
For every i I compute x = LCM(LCM(1...i-1), LCM(i+1...n)) (I've got these values from preprocessing) and check if x%t[i] == 0 and x > 10e9.

I have no idea what is wrong, but I keep getting WA on test #6.

Full text and comments »

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

By tom, 10 years ago, In English

Hello everyone,

For a long time I've been preparing for various algorithm's contests. I do several problems each day, read articles, tutorials and so on. I see I've made big progress.

But I think I can make bigger with you together.

I'm looking for willing guys to prepare for contests, learn and analyze problems and codes together. I hope we would share and exchange our experiences and getting better faster as we could do that for our own.

My goals for this years are: take a part in National Championship and qualify to ACM Regional Contest.

If you're looking for someone, too, please message me.

High five!

Full text and comments »

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