ScarletS's blog

By ScarletS, history, 2 months ago, In English

A — Star

Solution

B — uNrEaDaBlE sTrInG

Solution

C — Kaprekar Number

Solution

D — Base n

Solution

E — Train

Solution

F — Potion

Solution
 
 
 
 
  • Vote: I like it
  • +34
  • Vote: I do not like it

»
2 months ago, # |
  Vote: I like it +44 Vote: I do not like it

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

»
2 months ago, # |
  Vote: I like it +3 Vote: I do not like it

A,B and C were easier this time..

»
2 months ago, # |
  Vote: I like it +14 Vote: I do not like it

Why the LATEX disappears 5 second after opening some solution?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Is it still being weird?

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Why my code showing TLE at after_contest_2 and after_contest_3 test case

      My submission link

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it +1 Vote: I do not like it

        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.

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

          Or we can do this: if (dis[u] < d) continue;

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

      Not now, thanks sir:).

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

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}$$$

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

.

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

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