Блог пользователя beatoriche

Автор beatoriche, история, 11 лет назад, По-русски

В ночь со вторника на среду в 04:00 MSK состоится 666-й Topcoder SRM.

Учите латынь! :) Никто в аду на английском с вами разговаривать не будет! :)

  • Проголосовать: нравится
  • +52
  • Проголосовать: не нравится

»
11 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +6 Проголосовать: не нравится

The contest will be in morning (6:30) in India, it is going to be a tough time ahead for me to get up in the morning :P

  • »
    »
    11 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    You have just saved me before waking up at 6 AM — I am currently in USA and timeanddate.com showed me it will be on 6:00 and I thought that I will have to wake up early, but thanks to you I realized that it was 6 PM :P.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +31 Проголосовать: не нравится

I guess scoring will be 333-666-999

»
11 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

It will be 4 AM here in SYRIA, but thanks for reminding me :)

Anyway I will find a strategy to wake up at this time :D

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

8-10PM here in the U.S!

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +45 Проголосовать: не нравится

This is going to be a very strange and spooky SRM. Maybe it will even be rated.

»
11 лет назад, скрыть # |
Rev. 8  
Проголосовать: нравится +8 Проголосовать: не нравится

666: Can it be??

▲
                                      `-.`'.-'
                                   `-.        .-'.
                                `-.    -./\.-    .-'
                                    -.  /_|\  .-
                                `-.   `/____\'   .-'.
                             `-.    -./.-""-.\.-      '
                                `-.  /< (()) >\  .-'
                              -   .`/__`-..-'__\'   .-
                            ,...`-./___|____|___\.-'.,.
                               ,-'   ,` . . ',   `-,
                            ,-'   ________________  `-
»
11 лет назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

Commenting here so that this blog comes back into recent actions.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

Hell has opened its gates, I mean, registration has started.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится

Ugh, I haven't seen more repulsive problem than 888 in a long while >_>. TankEngineer submitted it in my room, so after realizing how tedious it is in coding phase I decided to prepare a test which will cover many stupid cases and challenge him blindly with it and it turned out to be a good choice :P. Currently there are still 4 unhacked submissions, but I will be surprised if at least one will be correct...

  • »
    »
    11 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится +2 Проголосовать: не нравится

    What was the test case? Turns out that you're really lucky — all other submissions for 888 are correct.

    • »
      »
      »
      11 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      Hah, yeah, indeed it looks like I was very lucky on this one : D.

      This was the test:

      999
      5
      2,2,4,7,1,10,13,20,30,34,36,30,40,43,45,40,10,50,52,54,55,50,57,58,50,61,49,70,71,75,80,82,85,90,90,89,95,94,93,102
      3,6,5,8,9,11,18,21,32,34,38,39,41,43,45,46,21,51,53,54,55,55,57,58,59,62,64,77,73,77,87,83,86,90,91,92,95,97,99,105
      

      Is there an option to somehow execute other people's solutions? I would like to test them against this testcase :P. However afair tests from successful challenges are added to systests, so it is very improbable that those accepted solutions will fail at this one, right?

      Btw in statement there wasn't mentioned is that possible to have identical intervals and my test contained such on beginning but it was rejected because of that :d.

      • »
        »
        »
        »
        11 лет назад, скрыть # ^ |
         
        Проголосовать: нравится 0 Проголосовать: не нравится

        It was mentioned in the 'constraints' section that no two intervals are equal.

        What is so special about your testcase? What is the correct answer?

        • »
          »
          »
          »
          »
          11 лет назад, скрыть # ^ |
           
          Проголосовать: нравится 0 Проголосовать: не нравится

          OK, so maybe I overlooked that equal intervals, nevermind :P.

          If you look from a correct angle on this problem then maybe there are no special testcases at all, if you would be looking from angle I have used (not the best one) then you would observe tons of ugly cases :P. Since I didn't complete coding I don't know what is the answer — I was informed what is the correct answer when hacking, but I didn't write that down.

  • »
    »
    11 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    I dunno, it didn't seem all that ugly to me. A lot of cases can be cleared by adding leaves representing spaces not in the given intervals and one topmost interval (the condition of even sum is just a matter of one zeroing loop). Then there's just the case of filling a small interval with all 1s.

    I could've done it (maybe) if I hadn't moved to 222 thinking I'd solve it quickly and return...

    • »
      »
      »
      11 лет назад, скрыть # ^ |
       
      Проголосовать: нравится +5 Проголосовать: не нравится

      Just to be sure that we are talking about the same solution — I assume that intended solution is something like dp[interval][number of ones from left][number of ones from right] in tree formed by intervals with additional beautiful case of whole interval covered with ones? It looks like it could definitely be done like that, however number of weird things to check is over nine thousand. After fixing those number of ones from left and right they can arrange with children in many incredibly annoying configurations, not to mention that case with all ones...

      I have to admit that I'm really surprised that someone managed to get this accepted, so maybe I'm just missing a nice way to cover many cases in some tricky way or I'm looking at whole problem from a misleading angle.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +25 Проголосовать: не нравится

Whoa, that's fast system testing.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I was the only one who couldn't challenge others?

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

For Div2 Problem C, I realized it was DP, but how to approach it?

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

In Div2 Problem C I realized it was DP, but how to approach it?

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

222 is almost same as this one

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

I literally facepalmed when I realized how to solve 222 Div 1. It was surprisingly easy! And It took me an hour to realize the simplicity of it.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve Div 2 Hard using DP?

»
11 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -8 Проголосовать: не нравится

I didn't take part in the contest, but I found 444 much easier than 222.

I did them on practice mode and got 300 points on 444, but only 78 pts. on 222. The middle problem is very straightforward (divide the array into 2 or 3 parts, multiply accordingly, do combinatorics, etc.), while the "easy" problem requires a lot of case handling (Do I have to return here or do I finish elsewhere?, how many extra moves do I need to return to this node? (2?, maybe 3?), how many moves do I spend on this child and how many on this other one?, etc., etc.). I spent over half an hour debugging it...

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can somebody explain the method to solve Div 1. 444 problem?

  • »
    »
    11 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится +24 Проголосовать: не нравится

    The trick is to consider the last number in the permutation. Let DP[k] be the answer for size k. Then we have 2 possibilities: The last element is at the border (left or right) or it's in the middle. If it's in the border, it multiplies by n - 1, otherwise, it multiplies by n - 2. So, initially we have the value 2 * (n - 1) * DP[k - 1] for the cases when the last element is at a border. Then, consider we choose last element m, which is not in a border, then we will have a left portion of size l and a right portion of size r. Those two portions won't be connected, which means they are independent. We have every possible combination on one side multiplied by every possible combination on the other side. That means (n - 2) * DP[l] * DP[r]. But we're not quite finished yet, because we can alternate between choosing elements from one side and the other. The total number of ways to alternate between choosing elements from a section of size l and a section of size r is C[l + r][r] (combinatorics). So, for every m in the middle, we must add (n - 2) * DP[l] * DP[r] * C[l + r][r], where l and r are the remaining elements at each side of m.

    I hope I was clear, it's not easy to explain with words...

    • »
      »
      »
      11 лет назад, скрыть # ^ |
       
      Проголосовать: нравится -12 Проголосовать: не нравится

      You have to compute DP[1.. n][0 .. 2], where second dimension is number of taken borders, you completely disregarded number of taken borders in your description :d.

    • »
      »
      »
      11 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      i could not clearly get the combinatorics part :( can you please explain ?

      • »
        »
        »
        »
        11 лет назад, скрыть # ^ |
         
        Проголосовать: нравится +1 Проголосовать: не нравится

        Suppose you have a collection of red and blue balls, R red balls and B blue balls. There is no way to distinguish between two different balls of the same color. Your task is to put all R+B balls into one big box. How many ways are there to put all the balls into the box if you can take them in any order? Two ways are considered different if at some step, the color of the ball put into the box in that step is different.

        The solution: Consider an arbitrary arrangement of length R+B "RBBBRRBRBRB...R" corresponding to a given configuration. The question is analogue to "How many such arrangements are there?". You know the total length of the arrangement is R+B and exactly R elements are "R", so the answer is simply combinatorics for R taken out of R+B = .

»
11 лет назад, скрыть # |
Rev. 5  
Проголосовать: нравится 0 Проголосовать: не нравится
Unable to parse markup [type=CF_TEX]
#UPD
WTF!