Hello ,can any one help me to solve this problem ?

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

1 | Radewoosh | 3707 |

2 | Benq | 3691 |

3 | tourist | 3669 |

4 | ecnerwala | 3565 |

5 | Um_nik | 3533 |

6 | ksun48 | 3489 |

7 | maroonrk | 3457 |

7 | jiangly | 3457 |

9 | Petr | 3370 |

10 | scott_wu | 3350 |

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

1 | 1-gon | 208 |

2 | awoo | 187 |

3 | rng_58 | 184 |

4 | Errichto | 182 |

5 | SecondThread | 178 |

6 | Radewoosh | 177 |

7 | -is-this-fft- | 176 |

7 | maroonrk | 176 |

9 | Um_nik | 173 |

10 | antontrygubO_o | 170 |

Hello ,can any one help me to solve this problem ?

↑

↓

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jun/14/2021 22:17:01 (h3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

It will be solved with two pointers :)

Seems like this problem is stolen

one of my friends tell me we can using 2 pointers and we have 2 cases if s[l]=s[r] so we don't need any swaps otherwise we should find the rightmost character equal to s[l] but I don't understand why this observation works good for all cases

Yes, I entered ACPC kick off most of the problems were very unoriginal. I didn't like the contest anyways from its bad statements quality and no new ideas I found in it. I wasted an hour for 2 problems having unclear statements. 1 of them not saying the amount of testcases(or the limit of N all over testcases) and the other having just trash statement. I could've solved 10/11 out of 12 with that hour but I only solved 9 :/

I read those two statmentes for 10 times trying to find any difference between them in the end they meant the same thing • Any two numbers with the same number of ones in their binary representation are in the same subset. • No two numbers with different number of ones in their binary representation are in the same subset

{ 1 , 1 , 3 , 3 } this set satisfies the first condition but not the second one.