MikeMirzayanov's blog

By MikeMirzayanov, 9 years ago, translation, In English,
Hello!

I invite you to participate in Codeforces Beta Round #48. This time I acted as the author of the contest. I believe it is really exciting too! I urge you to follow my example. Codeforces is happy to contest authors.
With contest proposals please contact RAD (our problem coordinator).Participants are waiting for your problems!

UPD:
PDF statements will be also available after the contest start. Please, use the link.

I wish you beautiful solutions,
MikeMirzayanov
Announcement of Codeforces Beta Round #48
Announcement of Codeforces Beta Round #48
 
 
 
 
  • Vote: I like it
  • +64
  • Vote: I do not like it

9 years ago, # |
  Vote: I like it +8 Vote: I do not like it
Is this round supposed to be exceptionally hard?
9 years ago, # |
  Vote: I like it -8 Vote: I do not like it
Why does this round has 2 hours 30 minutes? More problems?
9 years ago, # |
  Vote: I like it -14 Vote: I do not like it
Problem B is too complex to understand :-/
  • 9 years ago, # ^ |
      Vote: I like it -9 Vote: I do not like it
    Yes, I can't understand it too!
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Maybe symbol + meaning concatenation instead of space would be more appropriate.
    • 9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      Notation used in task is rather common for describing Backus-Naur forms
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
I could not login using Gmail until now. Has anyone had a similar problem?
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Yes, it is well-known problem. I don't know the reason of such behavior. You may use "remind password" feature to setup new password and login into Codeforces
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Yes it said "http version not recognized" ..something like that in my opera..
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
War of Hackers.
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
What happens if you have a submission that you haven't locked by the end of the round? I left 1 of my problems unlocked accidentally today :/
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    nothing, except that you can`t hack solutions during the competition.
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    It's ok. You need to lock your submission only in order to hack
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    It doesn't matter whether you lock your problem or not. You'll get your points in case your solution is right.

    You have to lock if you wanna hack others' solutions.
    • 9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      Ah ok thanks! I was a bit worried that the system test would skip my submission.
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
So frustrated.
I did really bad on this contest.
9 years ago, # |
  Vote: I like it +5 Vote: I do not like it
Some of the test cases are too big to copy. How to get them?
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
I've always used printf for floating points, but here in codeforces I was afraid with these output problems and used cout. In problem C, I don't know exactly based on what but this time I didn't fixed the precision of cout expecting it would take care for me and my program got wrong answer. I resubmitted it now and adding just this line "cout << fixed << setprecision(10);"  it got AC.

Does anyone know how the cout define the decimal length when nothing is said?

Does %lf work correctly for doubles here?

9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
My sad story.
Like on TopCoder; reply to this with your sad stories.

On task C, around half an hour before the end of the contest, I noticed it was possible to print the distance in scientific notation (i.e. 1.5e+8). I asked whether it was OK. Then, I saw an answer "No" and resubmitted (so my points for the task dropped to 1000). Ten minutes later I noticed the "No" I saw was in the Broadcasted column and the actual answer was yes :D...
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    On task C,
    During competition i wrote (int)floor(p1+mid) and got WA.
    In practice i removed floor,i.e, (int)(p1+mid) and got Accepted.
    That just makes me sad!
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    For my D to pass system tests I just had to either change abs() to fabs() or std::abs(), or add "using namespace std;". I did neither, so it just used the abs for int from double argument without any compiler warnings. Stupid mistake, but very educational for the future... :)
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    On problem D, I misread the statement and assumed that the geometric ratio must be integer (though it may be fraction).
    After my program passed pretest, I locked D to hack other people's solution. Then I finally noticed my misreading with unsuccessful hack like "5 6". Thanks to this, I fell to yellow from red.
9 years ago, # |
Rev. 5   Vote: I like it 0 Vote: I do not like it
Why in problem A you didn't mention rotation of 0 or 360 degrees and wrote "they" instead? More intuitively is to rotate one amulet. According to the task two identical amulets are similar, because we can rotate them both for 90, 180 or 270 degrees and then the numbers of dots are equal...
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
My C-program's result  is "Runtime error" on test42 case at finaltest.
But, the same program works without "Runtime error" at "custom test" on test42 case.
Why does it mean ?
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    I tried your code on custom test and it returns runtime error. I think something wrong with your code
    • 9 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it
      I tried again, but my code doesn't return runtime error.
      It returns "
      0.500000
      29.500000 32.500000 36.500000

      =====
      Used: 10 ms, 1320 KB
      "
      Please try again,  at the code I submitted at last in the contest.

      I think case 42 is 
      6
      29 33 30 32 36 33

      Is it wrong ?
      • 9 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        What is happen!?
        After Dec 29, 2010 12:09:01 AM(submit ID 234372), my soucecode is accepted.
        It is no difference from the code I submited at the contest.

        If you fixed it, thank you!!

        I want to know what caused the problem.
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
What is happen!?
After Dec 29, 2010 12:09:01 AM(submit ID 234372), my soucecode is accepted.
It is no difference from the code I submited at the contest.

If you fixed it, thank you!!

I want to know what caused the problem.
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
I have a question about problem B. My solution contained the following lines of code. When I was testing it on my local computer by manually pasting input to the command line, it would never get past the while loop. However, it seems to work fine when I submitted it. I would appreciate it if someone could tell me why this happens.

Scanner in = new Scanner(System.in);
StringBuilder sb = new StringBuilder();
while(in.hasNextLine()) sb.append(in.nextLine());
  • 9 years ago, # ^ |
      Vote: I like it +12 Vote: I do not like it
    if your program reads from a console and you are testing it in the "interactive mode", you need to indicate the end of stream by sending EOF after you're done with entering all the input data. it could be done with either ctrl+z or ctrl+d, but it's actually platform-dependent and may not even work in some IDEs. alternatively, you can have your program read data from file using a redirection like "< input.txt"
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    if your program reads from a console and you are testing it in the "interactive mode", you need to indicate the end of stream by sending EOF after you're done with entering all the input data. it could be done with either ctrl+z or ctrl+d, but it's actually platform-dependent and may not even work in some IDEs. alternatively, you can have your program read data from file using a redirection like "< input.txt"
  • 9 years ago, # ^ |
      Vote: I like it +6 Vote: I do not like it
    I'm sorry for quite a few identical replies, man.

    The initial post didn't seem to go through and I decided to click the button once again. After that the site went down and started showing "all your bugs are belong to me" error message for a couple of minutes. But then all the sudden all my replies got posted, and I can't even delete them now.
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Problem 1
My solution couldnot pass test 14. Can you suggest reason for it?
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I think you are not giving importance to sequence of a,b,c,d.

    I think it is important.

9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
My solution to A got a runtime error on test 20 in the system testing phase. Could anyone tell me what I did wrong?

It passed a couple of test cases with 1000 tiles so memory or anything else should not be a problem....
  • 9 years ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it
    Actually, I got TLE20 with your code.
    Did you try any test with 1000 _different_ tiles?
    It seems that you start to read and write to unallocated memory and various interesting effects claimed as "undefined behavior" take place.

    P.S. And your code gets AC after changing 110 to 1100 =)
    • 9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      ah damn... stupid typo!

      I should have tested it with a large input... it passed the pretests so didnt bother checking it :P
      • 9 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Yes depending on pretest is a big mistake that we do.

        I lost my whole B. :( ...and egor who hacked 20 solutions..was in my room , why did he not hack mine ... :(

9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
My C-program is submitted at contest, the system return "runtime error".
But, I submit the same code many times after the contest, the system return "Accepted".

What does it mean?

The source code and run-ID is written on http://codepad.org/uQhX4kbi.

Please, check it.

I'm sorry to post comments many times, but I don't understood why my C-program was not accepted.
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I tried ur code...

    total 4 tests (no change in code during tests)

    test lang:GNU C++

    test1:runtime error testno.42

    test2:runtime error testno.50

    test3.runtime error testno.50

    test4.runtime error testno.50

    -----------------------------------

    test no. 50 was:

    6

    9 9 9 9 9 9

    • 9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      Thank you.
      I understood what caused the error.

      An iterator "p" can point to pos.end().
      And I used value, (*p).

      So my program sometimes can return runtime error.

      If I was lucky at the contest, my program might be  accepted.
      I want to be careful not to have the same error.

      Thank you for your testing.
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
I am waiting for tutorial for last problem .....