Tanzir5's blog

By Tanzir5, history, 7 years ago, In English

Hello Codeforces!

On Thursday, 20 April 2017, 13:00:00 GMT , an online mirror of the Bangladesh National High School Programming Contest (NHSPC 2017) will be held at Codeforces Gym.

The problems were prepared by :

Riddho, immuntasir, Jami_CSEDU, nafisiham, prophet_ov_darkness, raida_ash, shadowfax, Tanzir5 and bertho_coder.

This is an individual contest hosted as a preliminary selection contest for IOI participants of Bangladesh. You will have 3 hours to solve the problems. The setters have decided to rate the difficulty of the contest to be 3 stars. There's a wide variety of problems and we hope that you would enjoy the problems in general and have fun solving the contest.

Best of luck.

Update1:

The contest has finished. The top 5 are:

  1. SirirNicheBirirDokan

  2. sahedsohel

  3. mahbubcseju

  4. PM_ME_UR_PROBLEMS

  5. Farhod

Thanks everyone. The editorial will be posted very soon.

Update2:

Editorial has been published.

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

| Write comment?
»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Where is the link to the contest?

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

What about the link of the contest? How can we join it?

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

      I have participated in junior category and stood 3rd. In the contest name in gym its written senior category. Should I join that one or another contest for juniors will be held?

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

        You can participate in this contest.

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

          Shall I have to register or I can directly enter at the contest time?

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

            You don't have to register. You can directly enter the contest

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

How many problems are there? What's the idea behind having 3 hours instead of 5 hours like the IOI?

  • »
    »
    7 years ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    There are 8 problems. Actually this is the third edition of this contest. The previous two years, this contest has been arranged to motivate high schoolers for competitive programming. This year for the first time, it has been also used as a preliminary selection contest for Bangladesh IOI team. So the problems may be a bit different from IOI problems. That's why the number of problems and time length is different from IOI.

»
7 years ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

How to solve D ??? I tried so hard but could not do it ... I am feeling dumb :( Will editorials be posted ???

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

    The editorials will be posted soon. We are working on it. :)

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

    The answer is the number of numbers such that excluding that from nimsum will result in a number less than the main number.
    i.e first calculate nimsum. For each number ai, if (nimsumxorai) < ai then increase answer by 1.

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

      How did you arrive at it ???

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

        I arrive at this during the onsite contest.
        The key observation was, from a pile you can take pebbles in only one way to make a loosing state, if you take something more or less it will always lead yourself to loosing state.
        And to make a loosing state for other, it will be possible only if (nimsumxorai) < ai. Try to prove yourself :)

»
7 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Auto comment: topic has been updated by Tanzir5 (previous revision, new revision, compare).

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

Can I solve problem B with Binary Search on range [1..5000] ?

Also is the worst possible case 1 1 1e19 ?

I seem to be getting TLE with binary search Java

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

    range [0...5000] in case n >= p already also, how are you checking that the current mid is >= p?

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

      I am using BigDecimal compare which is has a O(lgn) complexity. So I compute x = (1+r%) once and then each iteration I do

      x^mid where mid = lo+hi>>1; is the number of years

      after that I do n*(x^mid); so as to complete the compound-interest formula.

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

        I've the same solution, may the problem be with power function (you need to do fast exponentiation) or with using the BigDecimal, I'm not sure about the O(lgn) complexity to be honest.

        Try using only doubles and unsigned long long for p, that will be sufficient

»
7 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Editorial has been published.