spar10's blog

By spar10, 5 weeks ago, In English

In INDIA two practice contests for the ICPC Preliminary Online round were conducted on 09/11/2024 and 14/11/2024 respectively at DOMjudge. The problems from the contests are as follows:

Practice Contest 1:

Practice Contest 2:

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

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

Do you have solutions to the problems ?

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    No as of now, but will update the blog if I get them

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone give a O(n logn) solution for problem Colliding balls.

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    From the problem, we make the observation that for the two balls to collide, they must be at the same coordinate at the same time.

    This leads us to the equation:

    $$$ X_i \cdot U_i = Y_i \cdot V_i $$$

    To solve the problem, you can iterate over $$$X_i \cdot U_i$$$ and check if there exists a corresponding $$$Y_i \cdot V_i$$$ that satisfies the equation.

    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I dont think it would be an optimal approach

      • »
        »
        »
        »
        5 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        It is ... We did the same and received ACCEPTED .... This is the most optimal approach ... You just have to take the inputs ...

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone explain count periodic number problem? I am getting time limit exceeded error and would like to know to know how to optimize the code

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    generate all valid mask and check if they are between $$$l..r$$$