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

Автор Bojack, история, 8 лет назад, По-английски

Let's discuss the problems.

Problem Set

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

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

How to solve C, D, H, J.

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

    If this contest has a time limit, Problem C is very interesting

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

    Is there any time limit?

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

    Problem C
    Let x be the number which has odd number of odd divisors​. Through observation, you can find that , where ei is even. In this configuration, total number of odd divisors will be . In other words, we are looking for x = 2w × y, where y is a perfect square number.

    You should solve the problem for range [1, N], and print solution of range [1, R] minus solution of range [1, L - 1]. To solve for [1, N], you should iterate for all possible power of 2. For each k, add .

    Problem D
    Firstly design a function f(n), which returns the highest number which is smaller than n, and has the digits allowed in the problem statement. This can be easily done with greedy observations.

    You can now start with input N, and iterate by setting N = f(N) each time. Stop this iteration and print the answer, when current N is prime. Use Miller-Rabin for primality testing. I don't know the proof why a prime number with the given definition can be found with small number of iterations. We went with intuition. If anyone can prove it, then please share it here.

    Problem H
    Trivial dynamic programming solution. States: idx, lastColor.

    Problem J
    You can always make the longest possible path in the answer graph equal to 1. Make the tree rooted. Toggle the direction of edges in consecutive levels to face different directions. Let's say u - v be an edge, where u is at level i. Set the direction of the edge from u to v. Now, let v - w be an edge, where v is at (i + 1)th level, Here set the direction from w to v.

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

Where I can submit?

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

What about problem D?

Our team got AC on problem C in a O(1) solution.

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

how to approach the problem I (Vugol search)????

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

does anyone have the problem set of onsite dhaka regional?