I found this problem and i really can't solve it using java because of the weak DS in java, i want to ask if this is the limits of java or just me who didn't know how to solve it, if you have any idea please help,

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

1 | tourist | 3851 |

2 | jiangly | 3634 |

3 | Um_nik | 3539 |

4 | slime | 3498 |

5 | ksun48 | 3493 |

6 | djq_cpp | 3486 |

7 | maroonrk | 3471 |

8 | MiracleFaFa | 3466 |

9 | Radewoosh | 3442 |

10 | Petr | 3426 |

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

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

2 | awoo | 181 |

3 | YouKn0wWho | 177 |

4 | Um_nik | 175 |

5 | dario2994 | 172 |

6 | Monogon | 170 |

6 | adamant | 170 |

8 | maroonrk | 169 |

9 | errorgorn | 166 |

10 | antontrygubO_o | 165 |

I found this problem and i really can't solve it using java because of the weak DS in java, i want to ask if this is the limits of java or just me who didn't know how to solve it, if you have any idea please help,

↑

↓

Codeforces (c) Copyright 2010-2022 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Aug/18/2022 23:38:20 (g2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

What was the time complexity of your solution? If it's nlogn (using order statistic tree) it should pass. Even an nlognlogn solution using binary search with segment tree might work.

Because of the relative speed/limit of the judge, there are some problems on CSES that are difficult to solve in Java just because Java is a little slower. For most problems the test cases are available on the submission site so you can try to download them test your program locally.