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

Автор hmehta, история, 5 лет назад, По-английски

Hey All!

Topcoder SRM 785 is scheduled to start at 12:00 UTC -4, May 09, 2020. Registration is now open in the Web Arena or Applet and will close 5 minutes before the match begins.

Thanks to espr1t for writing the problem set and misof for testing and coordinating the round.

This is the third SRM of Stage 3 of TCO20 Algorithm Tournament.

Stage 3 TCO20 Points Leaderboard | Topcoder Java Applet | Upcoming SRMs and MMs

Some Important Links

Match Results (To access match results, rating changes, challenges, failure test cases)
Problem Archive (Top access previous problems with their categories and success rates)
Problem Writing (To access everything related to problem writing at Topcoder)
Algorithm Rankings (To access Algorithm Rankings)
Editorials (To access recent Editorials)

Good luck to everyone!

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

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

Anyone else have problems with "Your login request timed out"? Web arena is working, but it is not really place where I want to write contest

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

I am getting Your JRE does not support AES-128, login not allowed :(, Any help?

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

Login Request timed out !

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

    Same here! :( Seems like the applet isn't working

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

    Same. Cant login.

    First stackoverflow answer of clearing cache didn't help. Redownloaded applet on ubuntu didn't help.

    Edit — ping www.topcoder.com takes forever on my wifi (JioFibre in India). Fortunately, I couldn't access topcoder 2 days ago as well and I knew switching to mobile data is the only way out. I never faced such problem in past with wifi. I'm sure there is no problem with wifi as I can access all other websites.

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

I was getting various errors, I got both "Your login request timed out" and "Your JRE does not support AES-128, login not allowed", however something like my fifth login attempt was successful. I suggest you guys just have to be persistent.

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

    Ouch. I figured it is close to a very well-known problem and can be given before — but tried finding similar problems and couldn't. None of the testers knew it was given either, sorry about that. :(

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

      For a fixed position, why is it never optimal to change more than one zero (say, three) to ones?

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

        If you solve the problem from the most-significant bits to less significant ones (and all more-significant ones are already okay) changing a single zero to one would fix the current bit. Changing 3 can also fix it, but they will require strictly more operations. And, since you are changing a number, it will have all-zeroes in its less-significant bits — thus, you won't have all-one bits case in the less-significant bits.

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

        Because when you change the digit from 0 to 1, the following ones become all 0, so they're all equivalent, so having three of those is not better than having one of those for the following digits. Therefore at least two of them can be kept all 0s. And then it's better to stop at 011111 instead of 100000 for those two.

      • »
        »
        »
        »
        5 лет назад, # ^ |
        Rev. 3   Проголосовать: нравится +7 Проголосовать: не нравится

        (Simpler explanation?)

        Assume that all numbers are in $$$[0,2^{b+1})$$$ and remain in that range at the end. First, sort them in increasing order. We can choose to increase the $$$x$$$ greatest elements less than $$$2^b$$$ such that all of them equal $$$2^b$$$, where the parity of $$$x$$$ is such that the $$$b$$$-th bit of the XOR is 1. Then take all numbers modulo $$$2^{b}$$$ and recurse for $$$b-1$$$. Note that

        • $$$x\le 2$$$ always. For example if $$$x=3$$$ then at least two of the increased numbers will still equal $$$2^b$$$ after all future increases. So it would take fewer increases to make two of them equal $$$2^b-1$$$ at the end instead (and the XOR would not change).
        • $$$x=2$$$ can be chosen at most once.

        This easily gives a $$$O(N\log^3 (10^9))$$$ solution. Code

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

    Well, OK. How is it possible that my Hard failed, while Danylo99 passed? It is exactly the same code (that's because of problem mentioned above was from team contest, where we participated together).

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

      undefined behavior in your code?

      this looks fishy:

      // assert(idx != -1)
      sum ^= A[idx];
      
      • »
        »
        »
        »
        5 лет назад, # ^ |
        Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится

        It is not the case as our codes are exactly the same (they differs only by LINF constant, but as answer never exceed 10^18, it doesn't matter).

        UPD. Sorry, I misunderstood. I will investigate it.

        UPD2. My constant INF was too small:)

»
5 лет назад, # |
  Проголосовать: нравится +29 Проголосовать: не нравится

Why do you write "variant of Nim" instead of "Nim"? We end up searching for differences from standard Nim even though there aren't any.

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

It is really depressing when there are 25 people above you with one less correctly solved task.

I started with TC rounds after many years of competing, and now they are most interesting rounds to me — probably because they require more standard programming skills than "IMO 1995 shortlist tricks". As well I understand people who likes opposite.

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

can someone explain the DP solution of DIV2 NIM

»
5 лет назад, # |
  Проголосовать: нравится +32 Проголосовать: не нравится

Anyone else have issues with the 500? I was repeatedly testing my solution on the max case; sometimes it would run in less than 3s and other times it would TLE ...

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

How do these leaderboard points exactly work? It's rather clean that Gennady won't advance for the second time, but is it expected that these $$$5$$$ points awards are awarded to him?

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

Sorry if this is a stupid question, but in DIV1 500, the statement says something like "calculate the expected value", and is the same for the editorial: "Calculate the chance (expected value)..."

This confused me a bit, aren't we supposed to calculate the probability of the ratings be the same, instead of the expected value? Not saying that I couldn't solve the problem because of this, but I want to know if I'm missing something

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

    When I read expected chance I thought of a meme like: a normal guy sitting down doing nothing: “probaility”. A super god with some lights going out of his head “expected chance”

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

Apparently topcoder allows numpy so I am trying to see if a python solution can pass the div1 500.

Although it takes less than 2 seconds on my machine, it can't even pass the n=42 example test case when running on topcoder's test servers. Anyone see any other optimizations? https://pastebin.com/QzVvNXCT

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

    This problem will be extremely hard to pass in Python I think. It is both very memory inefficient (although I believe the floats, in contrast to integers, are IEEE, thus may be okay) and very slow, and in this problem performance was crucial.

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

      Numpy is vectorized which is sometimes enough to make up for the slowness of the python glue code.

      My solution (linked above) runs the n=52 case in 1.5 seconds locally so it would've probably been fine if topcoder had slightly more modern CPUs!

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

    Virgin CF: error 13131313 when importing default libraries in runtime

    Chad TC: import numpy