One Point Solution

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 17 November 2011

SRM 524: ouch

Posted on 09:43 by Unknown
Well, here is what happened. I first opened the 500 , and although I reached some useful conclusions , like that you should be able to do binary search and that the maximum result is likely not larger than 2000, I didn't do much.

I noticed that 250 was probably very easy because of the large scores. I open it and...

Given a number, you subtract any positive, non-prime value out of it until you reach 0, return the minimum number of subtractions.

I began coding the standard prime check. Then it occured to me that if we find n is prime then we can subtract 1 else we subtract n. And then you can recurse and solve (n-1). I was about to compile that code, when I noticed that if it is prime we can just return 2.

Compiled, submitted. And of course right then I noticed that such lame logic does not work for number 3.

I fixed it and I already had a low score. My only hope was the challenge phase.

I prepared to open the median rated coder's solution. He had 242 points so I was pretty sure he missed the 3 case.

The challenge phase starts and I clicked the source VERY FAST. Of course, it turns out he missed the n=3 case. I was ready to challenge but then: The challenge button was missing. Yes, apparently there is a race condition that allows you to open source codes before the window receives the notion that you can challenge. So, if you open a source code in that milisecond, the window won't show the challenge button!

Once I noticed, it was too late, I closed the source, opened again and the challenge button was there, but the solution was already challenged.

I made a mistake then, I said that maybe there is still hope if I challenge another solution very fast, so I rushed to open something else, I didn't see any 3, but didn't pay too much attention to the source code, it turns out that it was fine.


After that I was just mad about the arena glitch that ruined my rating and decided that if my rating was going to die today because of some freak arena glitch, I'd rather also keep my volatility high. So I started doing random test cases. Was also interested to see if the apparently topsort solutions for the 500 in my room were correct, so I tried random challenges on them. Seems they are ok.
Email ThisBlogThis!Share to XShare to Facebook
Posted in badday, srm, topcoder | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • TopCoder SRM 557 - finally
    SRM 557 Explanation for division 1 Easy and match recap. Explanations for div2 easy and div2 medium. It feels like it has been ages since t...
  • SRM 589 Editorial
    I have finished writing the editorial for TopCoder SRM 589: http://apps.topcoder.com/wiki/display/tc/SRM+589 . As you most likely noticed. L...
  • SRM 590 recap and editorial
    Another week another Topcoder match. Not a great day. I had a bad flu and still do. Div1 500: The one with Xor Given a list of cards with nu...
  • SRM 546: relief
    I figured I should post something about this SRM. I've been very busy these weeks because the semester is ending and I tried to win a t-...
  • SRM 526: The killing wait for results
    While I wait for results, here is my perspective on this algorithm contest. It began with issues, it had to be postponed 15 minutes. TC has ...
  • SRM 554 div1 hard: TheBrickTowerHardDivOne
    Link to problem statement We got infinitely many bricks of dimensions 1x1x1 and C different colors. Count the number of towers of size 2x2...
  • SRM 533: Div1 500 MagicBoard explanation
    Finally solved it. It is a nice problem that is worth explaining in a post. You have a grid/board of at most 50x50 cells. Some cells contain...
  • Member SRM 505: Part 1
    So, let me explain a couple of problems from a Topcoder Member SRM that I wrote and never got an editorial. BTW, it was the last member SRM....
  • ListedLinks 2012-02-10
    Saturday Morning Breakfast Cereal comics: Grace Hopper's ghost That Oracle engineer blog post Oracle would really not like anyone to se...
  • Codeforces "Good bye 2013" round
    So it was a special round for coders of both divisions, problems ranged from the super easy problem A to the super difficult problems E,F,G....

Categories

  • acm
  • algorithm
  • answers
  • arenaplugin
  • badday
  • behindthescenes
  • bugs
  • c++
  • censorship
  • codechef
  • codeforces
  • contests
  • crocchamp
  • editorial
  • editorial.srm
  • embarrassing
  • explanation
  • gcj2013
  • gmp
  • goodday
  • google
  • googlecodejam
  • greed
  • groklaw
  • health
  • html
  • httpseverywhere
  • implementation
  • ipsc
  • ispc
  • java
  • kawigiedit
  • kindagoodday
  • lamebook
  • languages
  • lego
  • listedlinks
  • marathon
  • nasa
  • offtopic
  • ouch
  • postmortem
  • postportem
  • practical
  • probably_not_a_good_tip
  • problemsetting
  • programming
  • python
  • quora
  • rant
  • recap
  • slightlygoodday
  • snippet
  • srm
  • stl
  • strategy
  • swerc
  • tco
  • tco12
  • tco13
  • tco2012
  • tco2013
  • ternarysearch
  • topcoder
  • tricks
  • ubuntu
  • uva
  • vjass
  • vkcup
  • wc3
  • zinc

Blog Archive

  • ►  2014 (1)
    • ►  January (1)
  • ►  2013 (141)
    • ►  December (14)
    • ►  November (8)
    • ►  October (13)
    • ►  September (11)
    • ►  August (14)
    • ►  July (15)
    • ►  June (13)
    • ►  May (13)
    • ►  April (12)
    • ►  March (11)
    • ►  February (11)
    • ►  January (6)
  • ►  2012 (94)
    • ►  December (5)
    • ►  October (6)
    • ►  September (8)
    • ►  August (6)
    • ►  July (3)
    • ►  June (5)
    • ►  May (8)
    • ►  April (10)
    • ►  March (20)
    • ►  February (16)
    • ►  January (7)
  • ▼  2011 (51)
    • ►  December (7)
    • ▼  November (12)
      • SRM 595: And now , for something completely different
      • Seriously google, what's wrong with you?
      • SWERC 2011, D, F, G, H and almost E
      • Codeforces Beta round #95
      • Codechef November cook-off
      • SRM 524: LongestSequence, finally!
      • SRM 524: ouch
      • Maybe prefixing it with PROTIP in the forums would...
      • You know that thing they call practice? Don't do it
      • The trick: Resetting arrays in no time.
      • SRM 523: Behind the scenes and predictions
      • Is Google losing its touch?
    • ►  October (5)
    • ►  September (1)
    • ►  August (3)
    • ►  July (4)
    • ►  June (3)
    • ►  May (7)
    • ►  April (3)
    • ►  March (2)
    • ►  February (1)
    • ►  January (3)
  • ►  2010 (9)
    • ►  December (4)
    • ►  October (1)
    • ►  June (1)
    • ►  May (1)
    • ►  January (2)
  • ►  2009 (1)
    • ►  December (1)
Powered by Blogger.

About Me

Unknown
View my complete profile