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

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

Hello CodeForces Community! I would like to take this opportunity to extend this invitation for CodeChef May Cook-Off. As usual it is scheduled for the second last Sunday of the month.

Joining me on the problem setting panel, we have:

  • Problem setter: Pepe.Chess (Hussain Kara Fallah)

  • Testers: kingofnumbers (Hasan Jaddouh) and iscsi (Istvan Nagy)

  • Editorialist: T1duS (Udit Sanghi)

  • Language Verifier : arjunarul (Arjun Arul)

  • Russian Translator : CherryTree (Sergey Kulik)

  • Mandarin Translator: huzecong (Hu Zecong)

  • Vietnamese Translator: VNOI Team

You will be provided by 5 problems of various difficulties to solve during 2 hours and 30 minutes, I have found the problemset very interesting and I recommend coders of various skills to participate especially GrandMasters, please feel free to provide your feedback in the comments section after the contest, I hope you will enjoy solving the problem set.

You can find the rest of the details about the contest below.

Time: Sunday, 21st May, 2017 at 21:30 HRS (IST) (Indian Standard Time — +5:30 GMT) — Check your timezone.

Details: https://www.codechef.com/COOK82

Registration: You just need to have a CodeChef handle to participate. For all those, who are interested and do not have a CodeChef handle, are requested to register in order to participate.

Prizes: Top 10 performers in Global and Indian category will get CodeChef laddus, with which the winners can claim cool CodeChef goodies. Know more here: https://www.codechef.com/laddu. (For those who have not yet got their previous winning, please send an email to [email protected])

Good Luck! Hope to see you participating!!

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

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

25 minutes left to start!

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

Did someone manage to solve "Nasty Queries" using a Segment Tree?

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

How to approach Nasty Queries?

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

    The degree of any vertex must be even.

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

      Yes but why does the solution use hashes? Sorry if this is a stupid question.

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

        The degrees are even means all the endpoints in the given query range appear even number of times. So your query basically is to check if there's any element with odd frequency in given range.

        You can do that by checking if the xor of elements in that range is zero (if each number appears even number of times, they cancel out in pairs). This solution might give wrong decisions for some set of values like: 1, 2, 3. Even though their xor is zero, all of them have odd frequency.

        The idea is to hash each number from 1 to n to distinct and very large numbers chosen randomly so that the probability of such sets occurring becomes very small. Then you can simply check for zero xor.

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

That deceiving scoreboard submissions got me again. For 2 hours i was trying to squeeze C with either bitset+sqrt -_-. And then read D in last 30 mins. Solution to D appeared so easy to me with just Deque use (Submission)

Btw did anyone do C without hashing? I really hope there exists some solution without hashing.

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

can anybody tell bug in my code of nasty query

simple approach through xor code

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

For Hussain set, some solutions with 10*N*log(10*N) also passed. Mine not among them :(

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

Solution for Hussain Set?

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

How to solve E ?

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

How can I submit after the contest?

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

Is there any deterministic solution for problem D?