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

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

A — Star

Solution

B — uNrEaDaBlE sTrInG

Solution

C — Kaprekar Number

Solution

D — Base n

Solution

E — Train

Solution

F — Potion

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

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

Right before posting this the first time, I ended up deleting it accidentally and had to rewrite it :)

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

A,B and C were easier this time..

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

Why the LATEX disappears 5 second after opening some solution?

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

    Is it still being weird?

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

      Why my code showing TLE at after_contest_2 and after_contest_3 test case

      My submission link

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

        That's because, when you are updating the distance in the priority queue, you should also delete the previous wrong distance which might be already present in the priority queue. In your code, multiple copies of the wrong distance are increasing as you are only deleting the top one. Hence queue size is increasing very fast. Ultimately results in TLE.

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

      Not now, thanks sir:).

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

Sub to D Can someone help me with this code? My approach was to find b such that $$$a_nb^n=m$$$, and the required answer if possible will be lesser than b, so that i will decrement till i find the polynomial to be less than m.Random tc Can someone also explain this as well? My code when i stress tested it worked fine for $$$m<=10^{16}$$$

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

.

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

    It's part of the standard Dijkstra implementation, it ensures you don't needlessly visit the same node multiple times.