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

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

ನಮಸ್ಕಾರ ಕೋಡ್‌ಫೋರ್ಸಸ್ (Hello Codeforces)!

We invite you to participate in CodeChef’s March Cook-Off, this Saturday, 5th March, rated for all.

Time: 8 PM — 10:30 PM IST. Note the new schedule.

Web3 giant Chingari is onboard to pick their recruits in the areas of Machine Learning, Rust and Web3.

These job openings are for Indians, and Non-Indians (who can work from home), and are experienced in any of the following: Rust, React, Golang,C/ C++, Python, Machine Learning, Deep Learning, Data Mining, Recommendation Systems etc. You’re also a desirable candidate if you have a deep understanding of the blockchain and cryptocurrency space and smart contract systems, specifically having a good understanding of Solana. The application for the openings are given in the Cook-Off contest landing page.

This edition of CookOff is part of the NITK annual CP contest called Inscription. We have many more tech events under our annual tech fast called Engineer 2022. You can check our events out here. Most of the problems of this contest were written by the undergraduate students of NITK ^_^

The contest will be 2.5 hours long. There will be 7 problems in Div 1/3 and 8 problems in Div 2/4. It will be rated for all four Divisions.

Joining me on the problem setting panel are:

Prizes:

  • Top 10 global Division One users will get $100 each.
  • Top 25 Indian Division One coders to get Amazon Vouchers worth Rs. 1500 each.

The video editorials of the problems will be available on our YouTube channel as soon as the contest ends. Subscribe to get notifications about our new editorials.

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!

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

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

happy to participate now that codechef plagiarises copied codes

Fair competition

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

unfortunately leetcode biweekly and march cook off at same time :'(

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

Reminder: Contest starts in 30 minutes.

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

Atcoder > Codeforces >> Leetcode >>>>>>> Codechef

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

Screenshot-2022-03-05-212857

What is this judge's error?

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

After an hour thinking about NANDXOR, I just tried $$$O(n^4)$$$ brute force with $$$min(n, 100)$$$ without having convinced myself that a solution would be found, and it passed. I guess that's the intended solution but I feel like cheating for not being able to prove it.

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

    Hint: Pigeonhole principle.

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

      I noticed about the 30 possible values but I was confused about what would happen if two equal popcounts share an element of the array. It turns out we just need 62 elements so we have 31 non intersecting pairs. Thanks.

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

    [Deleted]

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

lmfao my code with random_shuffle() 100 times passed NANDXOR

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

    This is because there are only ~30 possible values of the number of set bits. So random shuffling gives you a 1/30 chance of finding a valid pair. The chance of finding it over 100 such attempts is: 1 — (29/30)^100 => 97%.

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

Can someone tell what is the 18th test case for NANDXOR? I tried to debug for almost two hrs, still not able to find the issue with the code.

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

Can someone tell why this code gives wrong answer? link.

Here I have used the logic that since popcount() can only give 32 values so it will always repeat after some fixed number of pairs and I am considering more than required amount in my interations I think.

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

My mistake in NANDXOR is I sorted the array and I didn't realize that :/ removing sort passed :/ :/

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

Thanks a lot for the contest, I really enjoyed it.

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

Okay, so are we just going to ignore the fact that checker for problem "Dragonado And XOR" seems to be broken? Trailing space casued WA for me, and I believe even on Codechef you ignore trailing spaces in all other problems by deafult? Even if not my "incorrect" submission gets WA only on testcase ~19 (not earlier), which is even stranger. Links to submissions (the only difference is putting trailing space everywhere in one of them): AC WA

Can someone elaborate? Dragonado

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

    I'm not entirely sure, but I believe CodeChef runs your code on all the testcase regardless of the verdict. so just because it says running test 19 doesn't mean the first 18 have gotten AC verdict. I've submitted completely invalid code and got it run on all the cases, but again, don't quote me on that one.

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

Ashishgup tabr very_slow For the problem "Dragonado And XOR" I was getting WA because I was printing space after the last printed integer.

Shouldn't this be taken care of by the checker?

AC: https://www.codechef.com/viewsolution/59774092

WA: https://www.codechef.com/viewsolution/59774089

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

    I faced a similar issue and took a lot of time to finally realize it. It should be explicitly mentioned if this was intended.

    Here is the link of my submission during the contest: https://www.codechef.com/viewsolution/59774459

    Here is the link to my submission after the contest: https://www.codechef.com/viewsolution/59774459

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

      I couldn't figure out this during the contest, though I doubted the checker and queried about the checker, and they replied checker was OK.

      It could have been an excellent contest for me, but got a negative delta instead :-/.

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

        CodeChef_admin Ashishgup nishant403 tabr
        Ig they have updated the checker and rejudged all the submissions and accordingly updated the ratings. But still, is it fine to do so? Like some users may have been trying it and wasted time on that NANDXOR problem, which if they could have got the AC verdict in one go, they may have solved the next problem as well. This was an issue from their side, so why don't make the round unrated for the users who are getting a negative delta just because of their mistake.

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

    Thanks a lot.

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

    You have taken max 15 for n, shouldn't we try max 62 for n?

    What was the logic?

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

      You only need to check 62 pairs, by taking the first 15 elements you can generate (15*14)/2=105 pairs.

      Edit: this is incorrect because we cant ensure pairs don't share an element.

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

        How do you know your pairs don't share an element? It is clear that having 62 elements you can get 31 pairs not sharing elements. I'm not sure about what you said though.

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

    I also faced the same issue and got 2 WAs before getting AC.

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

I think that the tests for Dragonado And XOR might be weak. My solution where I am checking only the first ten elements works.

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

    There are only 30 values possible. For the first 10 elements, you have approx 45 pairs.. so there is high chance 2 pairs might match.

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

The problem NANDXOR had an issue in the checker — participants outputting extra whitespaces were getting a WA instead of AC. The checker has been fixed, all non-AC submissions rejudged, and ratings recalculated. A total of 26 users across all divisions had at least one of their submission's verdict changed due to the rejudge, and we apologize for this mistake. Among those 26 affected participants, 8 users had their rating decrease for the contest, and that decrease has been reversed for them to have a net of +0 rating change in this contest. That is, the contest is unrated for those 8 participants. An email has been sent to all the 26 affected participants.

Apologies again for the issue.