When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

ScarletS's blog

By ScarletS, history, 3 years 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

| Write comment?
»
3 years 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 :)

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

A,B and C were easier this time..

»
3 years ago, # |
  Vote: I like it +14 Vote: I do not like it

Why the LATEX disappears 5 second after opening some solution?

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

    Is it still being weird?

    • »
      »
      »
      3 years 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

      • »
        »
        »
        »
        3 years 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.

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

      Not now, thanks sir:).

»
3 years 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}$$$

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

.

  • »
    »
    3 years 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.