Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Finding Elements Lesser than X in set/multiset and then delete that element
Разница между en1 и en2, 2 символ(ов) изменены
I am doing a problem which requires similar operation in which we have to find element smaller than x then delete it from multiset then find for another x. ↵
I am using an approach that is giving TLE for 10^5 constraints↵

[Problem Link](https://www.codechef.com/problems/CHEFTMA)↵

[My Code](https://pastebin.com/skz4FF8j)↵

Is my method to find that element wrong or is it anything else.↵
PS -> I am not very clear on how to find Elements Lesser than X in set/multiset and its working I used ↵
auto it = *lower_bound(st.rbegin(),st.rend(),a[i],greater<int>());↵
As I saw it in blog can anyone also explain how it works

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский dakshdixit183 2023-08-23 12:57:45 2 Tiny change: 'CHEFTMA)\n[My Code' -> 'CHEFTMA)\n\n[My Code'
en1 Английский dakshdixit183 2023-08-23 12:57:31 696 Initial revision (published)