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

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

There is a vector of intervals (called v) that is initially empty. There are Q queries to process. two types of queries might appear:

  1. Insert an interval (x, y) to an arbitrary place in v. (1 <= x <= y <= 10 ^ 5)

  2. What is the last interval among the first t elements in v, that contains the number x?

the number of queries is at most 10 ^ 5

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

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

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

Hello everyone. My solution gets TLE on this problem. I have no idea what I'm doing wrong because my solution is quite similar to the one mentioned in the editorial. Can you help, please?

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

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

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

Hey everyone, hope you're having a great day. Here's a question about the famous post correspondence problem This problem is undecidable according to Wiki Pedia, which means there are no algorithms to solve the problem. but can't we simply try all possible permutations of the dominos? what am I misunderstanding?

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

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

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

Hey every one. Here’s a task: Find the least value of n such that 999 * (52! ^ n) > 1000 * ((52! — 1) ^ n) Can you help?

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

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

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

hey everyone. I have literally NO IDEA why this code gives me runtime error. It looks a little bit messy but pls help. thx in advance.

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

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

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

There are many reasons that people do cp here: 1. They are preparing for olympiads 2. They are training for some job interview 3. They become satisfied by becoming a GM, LGM, rank 1 competitor, etc… 4. they just enjoy solving problems because its fun and still do it even if they don't rank up or make money out of it! 5. Some other reason. I was wondering if anyone fits in the fourth category, so if you do please tell me in the comments!

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

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

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

Hi. Here's my solution for the latest div3 problem D : https://codeforces.me/contest/1385/submission/87172064

can somebody please help why it gets TLE? I checked my solutions with some accepted ones and the idea was the same.

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

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

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

Hello codeforces. I was solving this problem in EDU part that I faced a bug. as said in the video, to find the longest common substring of two strings s and t we should first build the suffix array of s + # + t. I did this and this caused me RE on test 2. and it turned out that the reason was the character # is smaller than the character (dollar) that we add to the end of the string at the beginning of building suffix array. but it was said that character (dollar) has to be the smallest character among all characters of the string. so to fix this issue we can use character ~ instead of #. and ~ is also bigger than character z. so we won't face any problem then. I wanted to make you aware of this.

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

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

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

next codechef cookoff round collides with next topcoder srm round!

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

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

Автор MOOONI, история, 5 лет назад, По-английски

Hello, I've realized in new codeforces contests that in lots of problems the input starts with an integer t ! the number of test cases,
so what is it used for ? why not just one test case instead of lots of them ? does it make judgement easier ? in past this way of representing input was not common, so what happened ? if you know answer to my questions above please answer in the comments :)

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

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

Автор MOOONI, история, 5 лет назад, По-английски

Hi guys! Here’s a problem I’m the author of it (and I don’t know the solution!) You are given a weighted tree with n nodes such that the weight of the ith node is w[i]. In each step you will do the following : Chose 2 adjacent nodes with weights V1 and V2. Delete the edge between them and put one of them on the other. Then the weight of the new node will be V1 + V2 and the cost of this action will be V1 + V2 as well. Now you are supposed to have a node with 0 adjacent nodes. What is the minimum cost of it?

So if you were given a tree with 2 nodes with weights 5 and 7 then the minimum cost would be 12.

I’ve not set any constraints yet but do your best on it! O(n * n) is preferred ...

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

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