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

Автор IceKnight1093, 4 года назад, По-английски

We invite you to participate in CodeChef’s Starters 70, this Wednesday, 21st December, rated till 6-stars (ie. for users with rating < 2500).

Time: 8 PM — 11:00 PM IST

Joining us on the problem setting panel are:

Written editorials will be available for all on discuss.codechef.com. Pro users can find the editorials directly on the problem pages after the contest.

The video editorials of the problems will be available for all users for 1 day as soon as the contest ends, after which they will be available only to Pro users.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Hope to see you participating. Good Luck!

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

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

How to solve Strange Bitwise Operation ?

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

can anyone give a test case on which this solution fails for two counter problem

Code

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

    for any two consecutive events, we can at least choose one of them. so I am greedily increasing score in the events we can increase score, given its previous events.

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

    10 6

    1 2 4 6 8 10

    1 1 2 1 2 1 Output : 5

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

      how is output 5. on which events we increase score.

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

        For i=1, increase value of b by 1 then a = 0, b = 1 and event 1 is applied and so a = 0, b = 0

        For i = 2 increase value of a by 1 then a = 1, b = 0 and event 1 is applied so our score is 1

        For i = 3 increase value of b by 1 then a = 1, b = 1 and no event is applied

        For i = 4 increase value of b by 1 then a = 1, b = 2 and event 2 is applied so our score is 2.

        For i = 5 increase value of a by 1 then a = 2, b = 2 and no event is applied

        For i = 6 increase value of a by 1 then a = 3, b = 2 and event 1 is applied so our score is 3

        For i = 7 increase value of b by 1 then a = 3, b = 3 and no event is applied

        For i = 8 increase value of b by 1 then a = 3, b = 4 and event 2 is applied so our score is 4

        For i = 9 increase value of a by 1 then a = 4, b = 4 and no event is applied

        For i = 10 increase value of a by 1 then a = 5, b = 4 and event 1 is applied so our score is 5

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

How To Solve X And Y Trees? I Was Trying To Solve It Using Euler Tour And Segment Tree. Anyone Who Implemented The Same Idea Or Any Other Sort Of Thing?

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

    I did it using that. Answer will decrease from n-1 to 0 until the whole tree becomes 1 then it will remain n-1. Code

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

    Some observations :

    Spoiler 1
    Spoiler 2
    Spoiler 3
    My solution

    In case if you any more doubts you can reply below this