# | User | Rating |
---|---|---|

1 | tourist | 3771 |

2 | jiangly | 3688 |

3 | Um_nik | 3539 |

4 | slime | 3498 |

5 | djq_cpp | 3486 |

6 | MiracleFaFa | 3466 |

7 | ksun48 | 3452 |

8 | Radewoosh | 3406 |

9 | greenheadstrange | 3393 |

10 | xtqqwq | 3382 |

# | User | Contrib. |
---|---|---|

1 | -is-this-fft- | 183 |

2 | awoo | 182 |

3 | YouKn0wWho | 177 |

4 | Um_nik | 175 |

5 | dario2994 | 172 |

5 | Monogon | 172 |

7 | antontrygubO_o | 167 |

7 | maroonrk | 167 |

7 | adamant | 167 |

10 | errorgorn | 164 |

link to question — https://www.codechef.com/problems/CHEFINV

MY APPROACH -

using a mergesort tree

find swaps decreased and increased for A[L] due to L-R

find swaps decreased and increased for A[R] due to L-R

calculate answer

complexity — Mlog^n?

my code — https://ideone.com/tgs2nU

i also tried testing my code against one of the AC codes still couldnt find my mistake. any help would be appreciated!

https://cses.fi/problemset/task/1684 => GIANT PIZZA

I cannot understand how to proceed with this question. Any help will be appreciated.

https://cses.fi/problemset/task/1160

can someone please help me in this question?

I am not getting any ideas as to how i should proceed...

question — Kuroni and Cowsheds

link to question — https://www.codechef.com/LTIME85A/problems/COWSHEDS

can someone please explain the solution?

I couldnt do better than Q*N basically go L to R + dsu

We can rotate a string any number of times

We need to find the minimum possible string lexicographically.

E.g. inp — BCABDADAB op — ABBCABDAD

This is doable by Booth's algorithm in O(n).

I couldnt quite understand the way it is being done...can someone please help?

but that isnt my doubt

so sum of all coprime numbers with n upto n = sum of all numbers part of phi(n) = phi(n)*(n/2)

i wrote the code for it.. apparently my function where i do the above computation was erroneous..

i tried stresstesting...here is my codee

its not giving correct anwer from around 1650... can someone please help? my functionname is phifunc editorial is phi

(P.S. i know that using sieve its n loglog n but both the editorial and my solution are sqrt n to it)

Codeforces (c) Copyright 2010-2022 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Aug/07/2022 22:11:56 (g1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|