aopo's blog

By aopo, history, 4 months ago, In English

There is a grid of ($$$10^{18}$$$, $$$10^{18}$$$) blocks. The person standing on (i, j) block can move to (2i, j) or (i, 2j) or (i-j, j) or(i, j-i) inside the grid. If he starts from (1, 1) output "Yes" if he/ she could reach (m, n) block else output "No".

Ex: Input:

3

1 2

4 7

10 10

Output:

Yes

Yes

No

Full text and comments »

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

By aopo, history, 14 months ago, In English

AcidRain

I tried solving it using the fact that there must be some collection of shield which should cover the entire range (B to E), but got the wrong answer. The tag says it to be related to dynamic programming. But how? I don't know. Can someone give any approach to how can it be solved with dp?

Full text and comments »

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

By aopo, history, 14 months ago, In English

Minimal Payment Can anyone suggest an approach to solve this one? It came in yesterday Atcoder Beginner Contest 231. The editorial is not clear to me and the sample code provided there is giving 404 error. Please someone help me with this!

Full text and comments »

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

By aopo, history, 17 months ago, In English

The official editorial of the Half Sequence says

This
Reason they give

But, what is the proof behind it? I mean what is the intution behind saying this? Can someone give a formal proof for it.

Full text and comments »

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

By aopo, history, 18 months ago, In English

Hello connections!

Recently i tried my hands on this problem. I solved it using segment tree and fenwick tree but i don't know how to solve it using LIS concept. It would be very nice if some of you can share your approach for solving this.

Here is what i think regarding this!

We maintain a multiset and go on inserting elements from left to right adding elements one by one , finding the upper_bound of ai and removing it if its exists and then doing ans=max(ans,*st.rbegin()) if the size of my multiset is bigger than l.But this is giving me WA.I don't know where am i going wrong.It would be very helpful if someone can point out my mistake.

Link to Problem

Full text and comments »

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

By aopo, history, 21 month(s) ago, In English

Hello guys, can someone help me in understanding the solution to this problem. I read the editorila several times yet i can't get it.I don't know why is it written so "Let's shorthand this with minNumber(colorCount, number[colorCount])." Can someone share his ideas or any approach for solving this problem. I bet this is one of the most interesting problem on ad-hoc,greedy!

Full text and comments »

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