pkhaustov's blog

By pkhaustov, 12 years ago, translation, In English

Hi, everyone!

The authors of Codeforces Round #152 are am-real, max777alex and me.

Special thanks to Gerald who helped us to prepare this round. Also, we want to thank Delinur for english statements. And we'd like to thank Seyaua and sdya for reading and testing problems of this round.

The round will be held on 25th of november at 19:30 in Moscow time, and it will take place in both divisions.

Score distribution div1: 1000 1000 1500 1500 2500

Score distribution div2: 500 1000 2000 2000 2500

Contest is over.

We appologize for ambiguity in the statement of the problem A. It was not clear whether it is possible to touch the goal post when the ball crosses the goal line. However, both ways to understand the problem statement were accepted. These solutions differ by an infinitesimal amount. The only thing that this ambiguity has effected a lot — hacks. All the hacks, which were based on the assumption that such touching is impossible, will be removed. Please, those who have done these hacks inform Gerald Agapov (Gerald).

We also apologize for the interuptions and problems with statements rendering.

Far from unanimous decision of the jury, it was decided to make this round rated. The rating will be recalculated on 26/11/2012 after removing of all relevant hacks.

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

| Write comment?
»
12 years ago, # |
  Vote: I like it -84 Vote: I do not like it

lets fun :))))

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

These contest on weekends are better for everyone. Everyone can participate. Good luck :)

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

open to all users??

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +91 Vote: I do not like it

    Only for Div 1, Div 2 and Unrated users :)

    • »
      »
      »
      12 years ago, # ^ |
        Vote: I like it -36 Vote: I do not like it

      Oh yeah, unfortunately, for only people :/

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

men. the contest was supposed to be at 12:00 (as i remember), so it is at 30:00 in VN. now it is at
19:30 (22:30 in VN, it means we do it til midnight). Can anyone tell me why the schedule is changed?

  • »
    »
    12 years ago, # ^ |
    Rev. 3   Vote: I like it +16 Vote: I do not like it

    There are always some countries where contests start at 1AM, 4AM... While you don't have the ability to create a contest on your own, live with it :)

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    The main reason is that it is the most convenient time for admins and writers to take care of the contest.

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

      This time it's because Opencup — very popular contest in Russia — will be held tomorrow at 11.00 MSK.

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

      Nope. In Russian branch of discussion I've explained that another popular Russian contest was scheduled for the same time. Many Russian programmers want to have an opportunity to take part in both contests.

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +43 Vote: I do not like it

    so it is at 30:00 in VN how many hours do you have in Vietnam :P ?

    • »
      »
      »
      12 years ago, # ^ |
        Vote: I like it -13 Vote: I do not like it

      how many hours do u want?;)

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

ints 00:55:00 before start :)

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

Why do people have to post such useless comments? If don't have anything good to write just don't do it.

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

huge problem statement.. :( (except B).

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +22 Vote: I do not like it

    As a non-native speaker of English. It took me a lot of time to understand the problem.

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

How terrible the contest is!

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

The contest is a disaster

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

wow!!! yeputons did the impossible!!! congratulation yeputons

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

For some reason I couldn't use scanf("%lf") to read doubles in problem A (div1), neither use printf("%Lf") to print long doubles. Both approaches gave me WA in pretest 1. It didn't count as wrong submissions, but annoyed me a bit.

Also, the sentence "_A goal is scored when the center of the ball crosses the OY axis in the given coordinate system between (0, y1) and (0, y2)._" is not really true, since the ball should not touch the posts (so (0, y1+r) for instance, is not a valid goal).

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

    For some reason, (0, y1+r) is a valid goal. I tried to hack a guy, who had the target there, but the hack wasn't successful :(

    • »
      »
      »
      12 years ago, # ^ |
        Vote: I like it +11 Vote: I do not like it

      Really? I asked about this during the contest and they said me (0, y1+r) is not a valid goal.

      Now I think they should make the round unrated if this point is important in some test case.

      • »
        »
        »
        »
        12 years ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        I dont think its a valid goal, since it will touch the post before crossing (or in the exact moment) in that sense I believe the problem statement is right, I had the same doubt and had to check it.

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

          Well, the answer is a bit subtle. The point itself is not a valid goal, but! if the problem has a solution at all, then the value of xw that hits this goal is within 1e-8 of a valid solution, so it should be accepted :-)

»
12 years ago, # |
Rev. 2   Vote: I like it +44 Vote: I do not like it

I don't know if it's my misunderstanding for problem A. I think the output for test case "1 99 100 9 90 9", where xb = r, should be "-1". But when I attempted to hack supergobble's solution, the system returned "Unsuccessful hacking attempt — Answer: 8.8902439024". Then, I successfully hacked hlwt's solution with the same test case. @,@

  • »
    »
    12 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Is x = 11.3333333 in example case 3 correct? the corresponding y is coming to be 5, right ? But 5 = 3 + radius, then why the answer is 11.3333333 ?

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    Oops, I got it.

    I totally misunderstood the meaning of goal =.=

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

      For example case 1 4 5 2 2 1 the line that aims at y1+r would definitely touch y2 so the answer should be -1, but your code outputs 1.11111111

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    I also don't understand problem A. In the test case 4 9 24 10 3 1 the judge says the answer is 4.7368421053, but my calculations show that the ball will pass through the lower goalpost.

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

      Never mind, I'd missed that it was the centre of the ball that had to pass the line.

    • »
      »
      »
      12 years ago, # ^ |
        Vote: I like it +6 Vote: I do not like it

      Actually I got tricked by the same thing (as well as many others, as far as I saw, Neal Wu also fails this test for example). The problem statements (at least the English versions) weren't the clearest ever xD

      Additionally confusing was that in real soccer rules the whole ball has to be inside :)

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

      Yes, I was also tricked by the fact that the ball is somehow allowed to touch the lower goalpost after the center has crossed the Y-axis. I assumed the logical aiming point was the centre of the goal.

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

awesome speed of servers :) that's already rly annoying

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

Egor96 must banned he have 6 succesful hacks to same person please read his code.

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

    All hacked answers differ by only one line ( if(n==x) print(-1); ) and so the hacked case would simply be x.... lol

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

      Same strategy than for the previous contest. Not very original :/

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

    Same story of lohoped ( with even greater this time: 9)

  • »
    »
    12 years ago, # ^ |
    Rev. 2   Vote: I like it +15 Vote: I do not like it

    lohoped is as same as Egor96.

    • »
      »
      »
      12 years ago, # ^ |
      Rev. 2   Vote: I like it -46 Vote: I do not like it
      Комментарий удален администрацией по причине несоблюдения правил сайта.
      • »
        »
        »
        »
        12 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        No, You are cheater.

        • »
          »
          »
          »
          »
          12 years ago, # ^ |
          Rev. 2   Vote: I like it -47 Vote: I do not like it
          Комментарий удален администрацией по причине несоблюдения правил сайта.
          • »
            »
            »
            »
            »
            »
            12 years ago, # ^ |
              Vote: I like it +1 Vote: I do not like it

            This reply display you are genius or cheater :D

            • »
              »
              »
              »
              »
              »
              »
              12 years ago, # ^ |
              Rev. 2   Vote: I like it -30 Vote: I do not like it
              Комментарий удален администрацией по причине несоблюдения правил сайта.
»
12 years ago, # |
Rev. 3   Vote: I like it +16 Vote: I do not like it

I dont know what type of mocking is this ... after finishin contest 10 minutes later suddenly it shows my B submission hacked .... so is it some ghost or admin self hacked my submission after contest ending ?

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

If one of my solutions was hacked, will this solution be tested on the final tests? Thank you in advance!

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    No, but I think that the results aren't final yet. I used testcase: 6 11 H..SSH The correct answer for this testcase is 0 (they can simply go from left to right and back), but your solution and also admins solution answered 1. When I realized this I let admins know and they rejudged these hacks, but there might be other similar testcases. Have any of you experienced similar problems?

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

      Did you get AC though? My program produces 0 as well — could that be a reason I was getting WA all the time?

»
12 years ago, # |
Rev. 2   Vote: I like it +47 Vote: I do not like it

non-algorithmic problems huge problem statements worst contest ever :|

  • »
    »
    12 years ago, # ^ |
      Vote: I like it -24 Vote: I do not like it

    Do you expect one liners?

    Sometimes the problem can't be expressed in lesser words.

    Can you try and reduce the length of problem C, without losing any detail?

    (and don't forget to add a legend. )

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

      I prefer delete problem C

      a problem with geometric O(1) solution

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

        So can you suggest another problem to replace it?

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

According to the Status page, it seems that the server is doing Final Tests in batches of 20 submissions at the same time, because of that the speed of testing has become faster. Also the "Pending system testing" phase was very short for this contest. Thanks to the sysadmins for the lovely speed optimizations!

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

looks like Div 1 system test exploded .

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

Nightmare.

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

At DIV-1 Problem B. 18 35 HHSSHHSSHHSSHHSSSH Some Accpet Code get 1 as result.

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

Very tough problem set.. It appeared to me as if I was trying to solve A ,B ,E, E, E .. Add to that the server problems

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

"25000 700000 1000000 1000000 325000 300000" can hack some Accepted codes for DIV1A.

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    And what's correct answer? Mine is -1

    • »
      »
      »
      12 years ago, # ^ |
      Rev. 3   Vote: I like it +5 Vote: I do not like it

      Nope, the answer is 500000 in fact. It depends on how you define "the center of the ball crosses the OY axis". This is an edge test. When I hacked others, I succeeded if the defender outputted "-1".

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

        My accepted solution outputs 500000. After all, in real life it's a goal :)

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

        I think everyone understood "the center of the ball crosses the OY axis" as "there should be a point in time when the ball's x<0 and it should not have hit any object before reaching this point"

        If so, then the judge solution would be wrong if it outputted 50000 for that case. Isn't it?

      • »
        »
        »
        »
        12 years ago, # ^ |
          Vote: I like it +9 Vote: I do not like it

        No I'm Pretty Sure The Answer Is -1 Because In the Middle Of The Way The Distance Of The Ball with the upper Point(y=700000) is exactly 300000 and by the definition of the question : "We assume that the ball touches an object, if the distance from the center of the ball to the object is no greater than the ball radius r." 300000 is not greater than 300000 so it touches the upper point. here is the picture of the situation: http://bayanbox.ir/user/amin.moghaddamv/Untitled.jpg?view

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

          It depends on how you define "the center of the ball crosses the OY axis". If you have crossed the OY axis, it doesn't matter whether the ball touches anything.

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

            actually it doesn't depend on that definition if you look at my picture in the point H the distance between ball and the upper post is exactly 300000.so the ball hit the post BEFORE crossing the OY axis.

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

          Hi, sorry for the off topic question, but what is the name of the software that you used to draw that picture? Thanks :)

          It always took me infinite amount of time to draw pictures for complicated geometry problem :(

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

    and what answer of this test? My solution get 500000.0000000

  • »
    »
    12 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    (10^6)^4 is lager than every unsigned long long number. I don't know whether high-precision is a must. I have to compare two number which may as large as 10^24 in my solution.

    Here's my ACCEPT very short code. yw -= r; yb = 2*yw — yb; y1 += r; double d2 = (double)(- xb * y2 + xb * y1) * (- xb * y2 + xb * y1) / (xb * xb + (yb — y1) * (yb — y1)); if(d2/r/r>=1-1e-11) printf("%.11f\n",(double)(xb * yw — xb * y1) / (yb — y1)); else cout<<-1<<endl;

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

What is going on??

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

Very slow judging. :(

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

Hard contest but without question which nobody solve it. :D

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

Div 2. Problem C. Can someone explain why for second test 1 4 6 2 2 1 xw = 0.75 is not correct answer?

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

    Cause in your case ball will hit the goalstop. "We assume that the ball touches an object, if the distance from the center of the ball to the object is no greater than the ball radius r."

    • »
      »
      »
      12 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      Can you show where I make mistake? But I do not pay attention to how the ball bounces off the wall. It depends somehow on its radius?

      0.75 / pos = (2 — 0.75) / (yw — yb);

      pos = 2.4; pos >= y1 + r && pos <= y2 — r;

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

        Hm... Your ball will intersect Oy below y1. How you are calculating pos?

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

          I considering the similarity of two triangles. That to fractions is tangents for angle of reflection. I consider the ball as a point in the reflection? Is that ok?

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

            you should consider the ball touch the OY axis(above the y2 or below the y1).

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

BJIAJL got 9 Successful hacking attempt of theRed, I think it's not normal things. One of the Submission is 2648987

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

In a proble B, i lost that than n==3 answer isn't corect...

if(n<=2){ cout<<-1; return 0; } for(i=0;i<n-3;i++){ k*=10; m*=10; m=m%210; //cout<<m; } cout<<1; for(i=1;i<n-3;i++){ cout<<0; } k=210-m; if(k<100){ cout<<0; } if(k<10){ cout<<0; }
cout<<k; system("pause");

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

Is it just me, or was problem D not available in English until the end of the contest? I think I would have found it a lot easier than some of the others.

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

    Problem B was also not available for like 15 min in the middle of the contest. The web page said: Unable to parse markup [type=CF_TEX] That was annoying.

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

    I had the same problem. I could not open for 20 minutes problem D(about the houses and shops) — Unable to parse markup [type=CF_TEX]. I nearly solved it during the contest(I needed 5-10 minutes more). Maybe I could have solved it, if I could have managed to open it earlier.

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

How soon will the rating updated?

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

DIV2 C Why is 4 9 30 3 3 1 result -1.

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

    Because you touch the right rod (the ball flies in ~0.136 of it) (I am sorry for my English)

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

      What is rod?

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

        goalpost, sorry. Right goalpost

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

          Goal wide is 5. Ball wide is 2. Why ball can't get to the goal?

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

            Think of it like playing real football. The center of the ball passing through doesn't mean anything. If any part of the ball touches the goalpost, it will bounce off (thus not counting as a goal). So it must always be at least 'r' away from either goalpost, otherwise, it will bounce off.

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

              Goal wide is 5. Ball wide is 2. r+2r+r=1+2+1=4 4 is less then 5. Can you explain better?

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

                Refer to the diagram. The ball has to be at least 'r' units away from the 'Y2' goalpost AT ALL TIMES.

          • »
            »
            »
            »
            »
            »
            12 years ago, # ^ |
              Vote: I like it +6 Vote: I do not like it

            I mean "red" distance.

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

My submission in Div2 — A is still judging ! 5 minutes above it judged "Accepted" , now I refresh the standing page and it say "running on test 57 — final test" . Anyone please tell me why ?

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

Very unusual contest

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

I think this round should be unrated, because of technical issues, rejudges and very unbalanced problemset

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

    God.I get a high rank that I never get before .So I hope this round should be rated.After all,it is ok.

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

      Same as you

    • »
      »
      »
      12 years ago, # ^ |
      Rev. 2   Vote: I like it +4 Vote: I do not like it

      Yep, I know that there're people like you. So, I think, it'll be okay, if this round will be rated. I only want to know what other contestants think about this.

      P.S. Congratulations!

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

hello Admin,

My submission for Problem B (Chilly Willy) with submission id 2648986 has been judged "wrong answer on test 11". For test 11, n = 3 and correct answer is 210. My code is giving the correct answer 210 for n = 3, on my local machine. But judgement protocol shows my o/p is 119 for n=3. Could you please help me to understand this. Thank you

  • »
    »
    12 years ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    The output must be divisible (mod must be equal to 0) by 2, 3, 5 and 7 at same time.

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

    I think the problem is the precision of pow(). pow(10,2) returns 99 in CF system, though pow(10,2) returns 100 in your local machine. (99+20 = 119 = 7*17, then your method return 119) This is because the pow() function is only for float and double, not integer.

  • »
    »
    12 years ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    :)

»
12 years ago, # |
Rev. 2   Vote: I like it +66 Vote: I do not like it

OH GOD WHY

please someone help me how to avoid this problem my submission

  • »
    »
    12 years ago, # ^ |
    Rev. 2   Vote: I like it +8 Vote: I do not like it

    try:

    #include <iomanip>
    
    cout << fixed << setprecision(13);
    
  • »
    »
    12 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    cout << fixed << sol << endl;

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

    cout.setf(ios::fixed);

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    I think you'd better to use printf("%.13lf", sol);

    • »
      »
      »
      12 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      One of the quirks of printf is that "%lf" is not always defined — "%f" is supposed to be for both float and double (float is promoted), while "%Lf" is for long double. All of this, of course, can be avoided by using cout :)

  • »
    »
    12 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    cout.setf(ios::fixed);

    cout.precision(13);

    cout<<sol<<endl;

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

    I got this problem too... this is suck... 11.3333 vs 11.3333333333 ( diff = 0.00003 ) is ok but 4.66667 vs 4.6666666667 is not ( diff= 0.00001 ).

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +19 Vote: I do not like it

    Actually, I think this is mostly judge problem. Getting WA with correct answer is totally unfair.

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +17 Vote: I do not like it

    When checking the correctness of the answer, all comparisons are made with the permissible absolute error, equal to 10^(-8).

    Absolute error? Really? You do realize that if the answer has 6 digits before the decimal point (as in this case) and 8 after, that's 14 digits, which is exactly on the edge of the 64-bit floating point precision (assuming the standard 52-bits for the mantissa).

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

Damn it. My eggs get pained while waiting for the rated result. God.It is 3:30 am now,get to the bed and have a sleep.

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

Final standings keep changing. Why call it Final standings? :)

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

I think final standings is not correct. For example, Div.1 winner yeputons submitted two wrong solutions on problem A, but it doesn't affect his score. Why is it?

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Get Wrong Answer on pretest 1 will not affect the score

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    That's because he got WA on first pretest. You don't get penalty if you fail on the 1st test case!

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

Why answer for test 7 is 4.5? What i'm getting wrong? https://www.dropbox.com/s/qjm3mcvpbq2mqwr/IMAG0050.jpg (sorry for darkness)

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

I'm not shure, if I understand the rating process wright, but I read, that it depends an your estimated ranking (namely the list, of registered people before the contest) und your real ranking. I was around 600th place before the contest in Div1. In this competition(due to missunderstood statements and small mistakes) I did not even solve a single problem, but most of the others also don't. So I got around place 100 -> does that mean, that my rating would increase, without solving a problem... (If it is so, it would be rather strange)

  • »
    »
    12 years ago, # ^ |
    Rev. 2   Vote: I like it +5 Vote: I do not like it

    1) Expected place is calculated using only participated people, so it's about 340, as far as I remember
    2) Your place is divided from 100 to 340, so you place seems to be used as 220

    BTW, as far as I remember there is fix now: if people with score <= 0 can't get rating icrease, but I'm not sure. There were discussions here, you can try to find it

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

Test #11 : 2 9 10 4 6 3 Why answer is 2.6666666667 < 3 ???

  • »
    »
    12 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    The answer must lie in the range 0 < x < xb = 4. What is the problem?

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

As of problem A, how can there be an answer with x < r?

In the statement, we have:

"...so the gate of Robo-Wallace's rivals may be not in the middle of the left WALL"

In a case where we aim to x , when x < r, the ball would bounce off the left wall first , am I correct?

  • »
    »
    12 years ago, # ^ |
    Rev. 3   Vote: I like it +22 Vote: I do not like it

    No, you are. The situation you and Zero_sharp are discussing may be below.

    • »
      »
      »
      12 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      I decided to simplify the task this way: yw-=r; y1+=r; After this all we need is to calculate position of the center of the ball. Then via school geometry you solve easy proportion. And the last calculation is to check a distance between left straight of the trajectory and y2. If the distance is lower than r then return the solution. Else return "-1". If somebody needs more detiles, I can draw some picture or watch the code.

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

the rating change should be reflected asap

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

Can jst ne1 clear my doubt on the compiler's absolutely different processing than the Ideone online compiler because my code worked correctly there and not here.... and yes i know my code would have any way produced wrong output further but it did nt even work on the 2nd preset of the div 2 problem B.....

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

    The CF system doesn't support "%lld" specification. Please use "%I64d", instead. BTW, the pow() function may return unexpected value. For the integer problem, you shouldn't use the function for float and double (, like pow()). pow(10, 4) returns 9999. Please make sure with custom test.

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

    The pow() function operates on floating point arguments and may return imprecise results. You should implement an integer power function yourself. Also, Codeforces officially recommends to use the non-standard %I64d/%I64u instead of %lld/%llu.

»
12 years ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

In Div2.C(Div1.A)problem,I got Wrong Answer on test case 8. My answer was 4.375000・・・. I can't understand "wrong answer Participant's ball hits left wall before goal". Please teach me what's wrong...

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

    You needed to check a distance between left straight of the trajectory and y2. If the distance is lower than r then return the solution. Else return "-1".

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

Rating has already updated!

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

link to editorial (English preferred) when it's published, please?

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

My rank in this contest is 514 : http://codeforces.me/contest/248/standings/page/6 . But in my profile page, it says 750 , and my rating go down for 51 points.

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

Could someone please tell me how to solve Problem B? I understand the binary search bit, but how do you find the minimum possible time for a fixed k?

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

No editorial this time?

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

I don't think anybody got the Robo Footballer problem right. I just tested several people's accepted code and none of them worked.

Example 1: 5 24 25 6 9 4

A correct answer is xw = 3.00000. None of the programs get this right. They all answered -1. The problem is that if you aim at 3.0000, the ball never gets near goal post 2. However, using the reflection method, which most people seem to have used, it falsely says that the path hits goal post 2.

Example 2: 1400 2499 2500 1200 900 500

Once you've fixed your code to handle the first example, then you have to make it recognize that example 2 has answer -1.

Unless you're careful, your program will think that xw = 100 is a solution. But it's not, because when you aim at that, you'll hit goal post 1 before the reflection.

A completely correct solution has to partition the path into two segments -- before and after the reflection -- and then make sure that both segments are free of collisions with the goal posts. To find xw, you have to intersect the ranges of xw that are collision free in both of the parts of the path.

--- Danny Sleator [email protected]

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

    I think another possible approach would be reflecting on yw , get the max angle where the top part goes in, then reflect on yw-2*r, get the min angle where the bottom part goes in, and if min<=max return the average.

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

How the %^* is this possible !?!?!?! Problem D — Wrong answer on test 95 Expected answer 130, found 131 -.- .....

Looks like correct solution needed this: if(wynik!=132) { cout<<wynik-1<<endl; } else { cout<<"130"<<endl; }

xD

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

no editorials ?

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

Can someone explain how to solve the problem Chilly Willy please ?

  • »
    »
    7 years ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    Let's look at numeric strings of length <= 3.

    The smallest number that fulfils this criteria and is divisible by 2, 3, 5 and 7 is lcm(2, 3, 5, 7) = 210. Hence, we can conclude that the answer for n <= 2 is -1 and the answer for n = 3 is 210.

    Now let's analyse the case where n > 3.

    From here, I assume that the answer string that we are generating is indexed from 0.

    The smallest numeric string of length n > 3 without leading zeros is 100... (i.e. A single 1 followed by n-1 zeros).

    Basic math tells us that any number that is divisible by both 2 and 5 must end with 0. So character n-1 (the last character) must be 0.

    That leaves us to check divisibility by 3 and 7. We can easily do so by long division and keeping track of the remainder. This works in O(n).

    Up till now our answer string is 1 {n -2 zeros} 0. Since lcm(2, 3, 5, 7) = 210, we know that in every 210 consecutive numbers, there is at least 1 number that is divisible by all four divisors.

    With this in mind, we can use 2 for-loops to manipulate characters n-2 and n-3 in our answer string.

    for i from 0 to 2 (both inclusive):
      for j from 0 to 9 (both inclusive):
    
        replace character n-3 with i
        replace character n-2 with j
    
        check divisibility of answer string by 3 and 7.
    
        if divisible
          return answer
    

    Let's look at the sample run of this algorithm for n = 5.

    Our answer string is initially "10000".

    i = 0, j = 0. string = "10000". Divisible by 2 and 5.
    i = 0, j = 1. string = "10010". Divisible by 2, 5 and 7.
    i = 0, j = 2. string = "10020". Divisible by 2, 3 and 5.
    i = 0, j = 3. string = "10030". Divisible by 2 and 5.
    i = 0, j = 4. string = "10040". Divisible by 2 and 5.
    i = 0, j = 5. string = "10050". Divisible by 2, 3 and 5.
    i = 0, j = 6. string = "10060". Divisible by 2 and 5.
    i = 0, j = 7. string = "10070". Divisible by 2 and 5.
    i = 0, j = 8. string = "10080". Divisible by 2, 3, 5 and 7. (answer found)
    

    Notice that we will run the 2 for-loops at most 21 times because we "add" 10 to our answer on each iteration. That means we don't iterate through all 210 consecutive numbers. Rather, we just have to check numbers in steps of 10 because the answer has to be divisible by 2 and 5.

    Hence, overall time complexity is O(21 * 2 * n) which fits well within the time limit for this problem.

    In case you have problems with the implementation, here is my solution (which uses this approach).

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

      Wow. I finally understood this today. Be greedy and find the smallest number of length n that satisfies the condition. The last digit is fixed.

      We want a number that's divisible by 3 and 7 since 2 and 5 are already guaranteed. This means we will check at most 21 numbers. (By the Chinese Remainder Theorem)

      Thanks a lot, Lance !

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

        You are most welcome! Actually, I think that you can pass the time limit for this problem even if you check divisibility by 2, 3, 5 and 7 since you just need to check at most 210 numbers (using the greedy strategy).

        I was just being a little picky by introducing that optimization. In fact, you can even do much faster than my optimized implementation.