Muaath_5's blog

By Muaath_5, history, 8 months ago, In English

Congrats heqr for getting a bronze medal.

Hard luck Essa2006, it was just 9 points from the bronze medal.

Best wishes for the Saudi team in next IOIs.

Full text and comments »

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

By Muaath_5, history, 13 months ago, In English

A: Security check in websites that want to prevent robots, just print "security"

B: The first 25 contests in codeforces, contests 15, 20, and 21 was unrated, so print NO if the contest was unrated, otherwise print YES

C: Every testcase will give you n numbers, where $$$n = PI_i$$$, so $$$n1 = 3$$$, $$$n2 = 1$$$, $$$n3 = 4$$$, and so on.., Print the product of numbers

D: Print any number that is guranteed that it won't come in the sequence, for example 0 or -1

E: Print any positive number (I don't know)

F: Print largest prime factor, don't calculate it, just put if

G: The image shows that he is a color blind, n is the length, s1 is what person sees, s2 is what is the real colors. Print YES if the person only sees the red color correctly.

H: Complex probabilities problem, because all the numbers are random (idk the solution)

I: Check if the bracket sequence is balanced, Consider letters "bdfhklt" as open bracket, and letters "gjpqy" as closed bracket, ignore other letters

J: Write "please" in any lettercase, and judge will give you AC

Full text and comments »

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

By Muaath_5, history, 13 months ago, In English

Recently, I solved 342E - Xenia and Tree using Sqrt decomposition.

The problem have two types of queries:

  • Color node $$$x$$$ red
  • Find minimum distance to any red color

I thought, what will be the solution if there is query: Color node $$$x$$$ blue?

I'm not sure if this is solvable using centroid decomposition, but is there another way?

Full text and comments »

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

By Muaath_5, 15 months ago, In English

I thought long time ago, why std doesn't have a segment_tree class? so I decided to create a similar one.

My template is a class in an STD-similar way, supporting lazy propagation.

A quick example on how does it look like:

Solving RMQ problem using my template

Just like that!!

It's available on a GitHub gist

So, what is your opinion about it? and how can I improve it?

Full text and comments »

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