MOOONI's blog

By MOOONI, history, 4 months ago, In English

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

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By MOOONI, history, 15 months ago, In English

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?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By MOOONI, history, 18 months ago, In English

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?

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

By MOOONI, history, 3 years ago, In English

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?

Full text and comments »

  • Vote: I like it
  • -10
  • Vote: I do not like it

By MOOONI, history, 3 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By MOOONI, history, 3 years ago, In English

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!

Full text and comments »

  • Vote: I like it
  • +38
  • Vote: I do not like it

By MOOONI, history, 4 years ago, In English

Hi. Here's my solution for the latest div3 problem D : https://mirror.codeforces.com/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.

Full text and comments »

  • Vote: I like it
  • +8
  • Vote: I do not like it

By MOOONI, history, 4 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • +16
  • Vote: I do not like it

By MOOONI, history, 5 years ago, In English

next codechef cookoff round collides with next topcoder srm round!

Full text and comments »

  • Vote: I like it
  • -11
  • Vote: I do not like it

By MOOONI, history, 5 years ago, In English

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 :)

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

By MOOONI, history, 5 years ago, In English

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 ...

Full text and comments »

  • Vote: I like it
  • -22
  • Vote: I do not like it