shashank21j's blog

By shashank21j, 12 years ago, In English

Hello Coders!

The July edition of 101 Hack is here. 5 interesting challenges in 2 hours. The contest commences on on 26th July 2014 at 13:00 UTC, You can sign up for the contest here.

The problem statements will be available in English, Russian and Chinese.
Top 10 on leaderboard get cool HackerRank T Shirts
Books for individual challenge-leaderboard toppers

Problem Setters
Gerald

Problem Tester
Bidhan

Please try all problems, Editorials will be available at the end of contest.

GL&HF

  • Vote: I like it
  • +28
  • Vote: I do not like it

| Write comment?
»
12 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

What's is sorting order on HackerRank (in particular on 101 Hack)?

»
12 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

If I just read the statement, will my rating change?

»
12 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Any idea for Xor and sum?

  • »
    »
    12 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Let's solve it bit by bit. It's easy to see that on bits with number BIG = 314159 + max(a.len(), b.len()) +-1 and greater the xor'ands are always 0.

    So for each bit we should calculate how many times it's 1. a[bit] is fixed and (b << i)[bit] are b[i], b[i — 1], b[i-314159]. With prefix sums you may understand how many times the last one is 1. So multiply it or (314159 + 1- it) by 2^bit (precalculated for all bits up to BIG)

»
12 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Sorry, but what is default stack limit for C++ solutions? Or where can I found information about it?