You are not logged in. Please login at to post your questions!


Two Paths INOI 2018

I have been trying to understand the logic behind this problem for a lot of days but couldn't get any near the answer. I would appreciate some help.

asked 11 Jan, 14:16

vaibhav2001's gravatar image

accept rate: 0%

From INOI 2018 Discussion , "For second one, The observation was that, we can take one path and calculate the total sum without a second path using dp[i][j][k] = min/max(dp[i-1][j][k], dp[i-1][j-1][k-1])+prefix_sum[i][j]. We calculate this two times, once for min and once for max and then we can use the prefix sum intuition to subtract min-dp from max-dp. It's not clear enough here, but you might get an essence."


answered 11 Jan, 18:23

shashwatchandr's gravatar image

accept rate: 0%

can you like explain it in a better way please.

(12 Jan, 12:30) vaibhav20011★
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 11 Jan, 14:16

question was seen: 75 times

last updated: 12 Jan, 12:30