S.P.A.R.K's blog

By S.P.A.R.K, history, 3 years ago, In English

i was on this problem for a while 1538G - Подарочный набор , i wrote my code 120665262 / https://codeforces.me/contest/1538/submission/120665262 for solution.

it gives WA on test case 2 where 1103rd numbers do not match.

i used basic geometry to solve the problem.(mayb its called linear programming — i dont know exactly.)

Anyone having suggestions what m doing wrong here. THANKS.

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

| Write comment?
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Since the point of intersection may not have integer coordinates you must search the nearby integer coordinates to find the maximum value.See my submission https://codeforces.me/contest/1538/submission/119986616