Блог пользователя Radiohead___

Автор Radiohead___, история, 20 месяцев назад, По-английски

hi everyone, I hope all of you doing well, I need help with this problem with proof for the solution to understand all the details plz . I was trying to play with the binary representation of the numbers because of the very large constrains of ai but i didn't reach for any valid solution. https://codeforces.me/edu/course/2/lesson/9/2/practice/contest/307093/problem/G

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор Radiohead___, история, 20 месяцев назад, По-английски

Hello everyone, I hope you are doing well, can anybody explain to me why this code costs O(n) on sets and multiset but in the other side it costs O(log(n)) on the sorted vectors.

the code ->

multiset ms; int x ; auto it = upper_bound(ms.begin() , ms.end() , x) ;

between this code cost O(log(n)) auto it = ms.upper_bound(x);

Полный текст и комментарии »

  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится