HolkinPV's blog

By HolkinPV, 14 years ago, translation, In English

Good day!

We are glad to introduce you regular Codeforces round for Div.2 participants. Everyone can traditionally participate in it.

Problems are prepared by Kholkin Pavel (HolkinPV), Rakhov Artem (RAD) and Nikolay Kuznetsov (NALP). Also thanks to Michael Mirzayanov (MikeMirzayanov) for perfect system, Mary Belova (Delinur) for translating problems and Agapov Gerald (Gerald) and Alexander Kouprin (Alex_KPR) for their help.

We decide to tell you some secret about todays problems. To solve them, you wiil propably use sort algorithm)

Score distribution is standard: 500, 1000, 1500, 2000, 2500.

We wish you success and high rating!

UPD: The contest is over, the tutorial will be here soon.

UPD2: Thanks everyone for participation. We hope you enjoy your problems. Congratulations to the winners:

  1. Touma_Kazusa
  2. ZJUT_AA
  3. wwhd
  4. jikwao425
  5. wtiger9999
  6. Jolin
  7. anmtcel
  8. marspeople
  9. ztxz16
  10. CrazyRabbit

Special congratulation to Touma_Kazusa, who solves all problems of the round.

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

| Write comment?
»
14 years ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

it's not a good idea to say how can we solve problems

  • »
    »
    14 years ago, hide # ^ |
     
    Vote: I like it +4 Vote: I do not like it

    but it's interesting :)

    • »
      »
      »
      14 years ago, hide # ^ |
       
      Vote: I like it -8 Vote: I do not like it

      oh, really? is it interesting to know what is the algorithm? :D

      • »
        »
        »
        »
        14 years ago, hide # ^ |
         
        Vote: I like it +5 Vote: I do not like it

        It isn't the entire algorithm, we just know that we have to use sort in the final answer. But it's better to find oneself... It's a too big hint, and all the contestants who have seen this post will be advantaged.

»
14 years ago, hide # |
 
Vote: I like it -12 Vote: I do not like it

Just curious to know why the site has not gone to safe mode today ...Its only 25 mins remaining and in some recent rounds the site went to safe mode some 1 hour back

»
14 years ago, hide # |
 
Vote: I like it +36 Vote: I do not like it

Someone has published problems D (id DOR17) and E (id DOR16) on SPOJ during the contest. Lame way of cheating...

  • »
    »
    14 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it +20 Vote: I do not like it

    Someone has no respect for authors and steals your problems. This person doesn't know anything about copyrights. We try your best to do the contest. That's why we shouldn't comment this ugly behavior.

  • »
    »
    14 years ago, hide # ^ |
     
    Vote: I like it +2 Vote: I do not like it

    I have just received an email from SPOJ. The problems were removed and the user got banned.

»
14 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

I feel very stupid right know... what was the issue with pretest 3 of problem C?

»
14 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

it would be so interesting if we could see our final rank now ;)

»
14 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Ahh

its my first time for entering the contest..

its very interesting :)

»
14 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

my submittion of problem A is kinda stuck it says accepted on final test but

where is question mark on it says waiting or judging. http://mirror.codeforces.com/contest/160/submission/1296903 what's wrong with it?

»
14 years ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

A,B,C explanations

Any idea about problem D?

»
14 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

is segment tree should be used in problem E?

»
14 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Why is the system testing stuck on 100% from the last 10 mins.I want to check my C solution ..

»
14 years ago, hide # |
 
Vote: I like it +12 Vote: I do not like it

Maybe it will be better to make such rounds not only for div2 but for mixed div1 and div2, because I think D and E were good enough for div1.

»
14 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

is there failed pretest or re-submission penalty from this round ? I saw the statement about this penalty during contest, but I think I did not receive penalty at my final score.

»
14 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can anyone explain why this submission (1304142) for C timed out? It works in O(n) time, I simply rad the array, count the occurencies of numbers using HashMap and then iterate at most n times. I see no way to fail it on timelimit... The only possibly slow operation is adding elements to map, but on other tests with maximum n, it worked in around 100ms. Where's the problem?

  • »
    »
    14 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Well, I submited the exactly same sulution again and it failed on another test, which run in 130ms before. I don't get it, where's the pitfall? Something in HashMap?

    • »
      »
      »
      14 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      They are antiquicksort tests. Shuffle the array after reading and get AC.

      • »
        »
        »
        »
        14 years ago, hide # ^ |
         
        Vote: I like it +1 Vote: I do not like it

        Well, it passed with Integer[] instead of int[]. I think this is the most stupid thing I ever saw on programming contest. I see no point in not letting pass the solution with the correct idea and implementation... Just because of testcase challenging in fact Arrays.sort method of Java authors, not my code. What will be next, tests concentrating on possible bugs in GCC compiler? I probably should start coding in Turing machine instructions in next round.

        • »
          »
          »
          »
          »
          14 years ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          tests concentrating on possible bugs in GCC compiler?

          Actually, there are a lot of cool stories of unsuccessfull hacks/TC challenges with correct output from function that returns correct value despite having no return statement inside.

          We should never believe a compiler and runtime library. C'est la vie

          • »
            »
            »
            »
            »
            »
            14 years ago, hide # ^ |
             
            Vote: I like it 0 Vote: I do not like it

            Yes, I fully understand this, in fact, I'm glad in some way that I have learned today about a pitfall in commonly used part of standard library. But there's a difference between non-defined behaviour of C/C++ and "abusing" a weak spot by carefully chosen input. In first case, a challenger/systemtester is in disadvantage and knows his attempt can fail. If he will succeed, a code with a bug will be identified and will gain zero points. He's aware about the risk, it's a lottery. In second case, it's about choosing a very special case that timeouts in fact correct solution. A coder who got a correct idea and implemented it will gain zero points. I see a clear difference between these cases. But, however, both of them are following rules and there's no one to blame. But it's questionable if the second one is fair. But yes, there's no "guilty", just a "victim". So the victim will write slightly angry comment after the contest and life moves on :)

»
14 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

It makes absolutely no sense that I failed C with an O(n log n) algorithm just bcoz I coded in Java. This gives no chance at all for Java coders. All I did was to sort and proceed like every other AC algorithm.

»
14 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I have a question concerning problem statement of 160D - Edges in MST. It says:

You are given a connected weighted undirected graph without any loops and multiple edges.

But in the first sample there is a loop: 1->2->3->1 Is the statement wrong or am I missing something?

»
14 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

can someone tell me one reason about why problem C time constrain is 1 second !!!!!!!!!! it's just totally nonsense , the wrong Algorithm will just fail the 2 sec time !!! my solution is O(n logn) and it failed in java but Acc in C++

THANKS !

  • »
    »
    14 years ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    When I saw the non-standard time limit I thought that they probably put it there to prevent anybody from attempting to solve that by brute force (i.e. creating all possible pairs, sorting them and then selecting the k-th one).

    However I agree that Java coders had a significant disadvantage here because of the Anti-Quicksort tests (I got lucky with Ruby I suppose). I agree that coders should think about worst-case complexity which is O(n^2) for Quicksort but if so this should affect all implementations and not just the ones in a single language.

»
14 years ago, hide # |
Rev. 6  
Vote: I like it 0 Vote: I do not like it

This is the first time I do in codeforces environment. So I'm sorry if this is an already known issue, but in problem C, using C++, reading a long long integer from std::cin isn't really operated, while on my local machine with gcc 4.2.1 does. I was struggling against this for an hour and found that using scanf("%I64d", &longint) only solves this.

  • »
    »
    14 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it +1 Vote: I do not like it

    I just took a look at your submissions and realized the problem is that you declared k as int, not long long.

»
14 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What a pity!The school network was broken at 23:30 and i could not finish the task...and my rating has decreased a lot. :-( TT

»
14 years ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

what pears do we have on this test?

3 3
1 1 2
»
14 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

is there anyone can tell me why i got WA on this submission? (http://mirror.codeforces.com/contest/160/submission/1299317) i tested on my computer and got a right answer. (15 lines of ‘at least one’)