Блог пользователя mkmeden

Автор mkmeden, история, 20 месяцев назад, По-английски

https://cses.fi/problemset/task/1671/

This is the task and at the first look its obvious that its a standard dijkstra problem, But due to some reason my code is giving TLE for 2 large test cases which I am sure the standard dijkstra code should be able to handle. Can someone take a look at this and provide some insight.

code

Failing TCs : https://cses.fi/file/6202e05529aba02706fe1c03ec7d07ed68c2e254b69047129b52185f875b9a1e/1/1/ https://cses.fi/file/a563cff68cf3d8ade012345cf49bc668cdb1f02f7a75317091066f81c0db16d5/1/1/

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор mkmeden, история, 20 месяцев назад, По-английски

Can some one help me undertand why this solution is giving a TLE for a particular test case.

Task :https://cses.fi/problemset/task/1193/

Solution :

Code

TLE test case : https://cses.fi/file/3d5f25fa10486d5059bfe87f28554e8fa18d9e0f1f1d6f27f3d3f3d324ab45f0/1/1/

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор mkmeden, история, 20 месяцев назад, По-английски

https://www.hackerrank.com/challenges/cloudy-day/problem

Stuck for 2 hours

can someone explain how to solve this question in a simpler way.Couldnt understand the editorial.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -6
  • Проголосовать: не нравится

Автор mkmeden, история, 21 месяц назад, По-английски

In the standard coin exchange problem were each denominations are available infinite times and we need to find the number of ways in which we can form the target value :

for a recursive function int fun(int n , int val) and the arr contains the denominations.

this is how the possible cases for the recursive calls should be .

Spoiler

But before seeing the solution I thought it like this instead ( definitely wrong )

Spoiler

I considered one more case too, where we take the coin and move to the next index . I cant find a reasoning why this is wrong logically .

Might be a stupid doubt but cant get over it just like that. Can anyone tell me why is it wrong to consider that case.

Thanks

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

Автор mkmeden, история, 21 месяц назад, По-английски

Can someone tell me whats wrong with my code

https://www.hackerrank.com/challenges/xor-and-sum/problem

Code

Полный текст и комментарии »

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

Автор mkmeden, история, 21 месяц назад, По-английски
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор mkmeden, история, 21 месяц назад, По-английски

https://www.hackerrank.com/challenges/bear-and-steady-gene/problem

Can someone please explain why my code is not passing some test cases.

Code

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

Автор mkmeden, история, 22 месяца назад, По-английски

https://www.hackerrank.com/challenges/tutzki-and-lcs/problem

I ve been trying to solve this for hours and could'nt find any understandable online solution, Can anyone explain the logic and code behind this problem.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +6
  • Проголосовать: не нравится

Автор mkmeden, история, 2 года назад, По-английски
  • Проголосовать: нравится
  • +6
  • Проголосовать: не нравится

Автор mkmeden, история, 2 года назад, По-английски

Hello,

https://codeforces.com/problemset/submission/1335/138670454

Can anyone explain why my submission is giving a RUNTIME_ERROR exit code: 2147483647, checker exit code: 0, verdict: RUNTIME_ERROR?

It works correctly on my linux terminal.

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится