celestialidiot's blog

By celestialidiot, history, 2 months ago, In English

Hi,

While solving the the problem D. Xenia and Bit Operations I am getting WA in the 7th test case.

My Approach: Using Segment tree to store the result of or and xor in each level. And then point update and then return segtree[0].

My Code

Please Advice.

Thanks.

Read more »

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

By celestialidiot, history, 3 months ago, In English

Hi,

Problem 520B. Two Buttons

My Code

My Approach : BFS with n as the root, then print the length of path from n to m. I am getting runtime error in test case 11.

Can any one please help me on this?

Thanks.

Read more »

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

By celestialidiot, history, 3 months ago, In English

Hi,

Problem : 1676E — Eating Queries

My Approach : I sorted the array in descending order and then calculated the prefix sum, and then I am using binary search to find the least element greater than x.

Can anyone please tell me why my code is giving TLE.

My Code

Thanks.

Read more »

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