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

Автор TARS, 3 года назад, По-английски

whenever I try to copy-paste a very long string or array values on my vs code terminal it throws the unnecessary value(sometimes some character goes missing), it always happens when I have to take the input test case first then the string or array values. I don't know what goes wrong with it, although it works perfectly fine when I pass value one by one by typing not just copy-pasting. if anyone knows how to fix this please let me know.

Take a look at the below:-  ![ ](https://codeforces.com/4a01b6/Screenshot (112).png)

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

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

Автор TARS, история, 4 года назад, По-английски

I'm solving a problem called number of smaller elements on the right side of an array. I saw stl solution based on the set they've used "distance(s.begin(), it)" I know how distance fn works on linear data structure but I don't know how it goes with a hierarchal structure like a set, etc.. Do you have an idea about how it works on trees?

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

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

Автор TARS, история, 4 года назад, По-английски

I've tried to solve this using sieve and prime factorization but I got TLE for some cases. Here is the CSES problem:) (https://cses.fi/problemset/task/1713/)

Here is my solution)

I need a more efficient approach.

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

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