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

Автор damon2598, история, 6 лет назад, По-английски

I was trying to solve this problem : http://codeforces.com/problemset/problem/1037/D (Valid BFS) . My submission is :http://codeforces.com/contest/1037/submission/45684523

My method : I am storing parent of each node (using bfs) . then , I am checking that is the new bfs following the order policy , using a queue . The code is neat and small . Please someone help me , I want to know where my algorithm is wrong .

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

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

Автор damon2598, история, 6 лет назад, По-английски

Today ,I saw a question on codechef October Lunchtime . The problem link is : https://www.codechef.com/LTIME65A/problems/NICARRAY I tried solving it recursively (for partial marks) . But I couldn't get it correct . Only the basic testcases are passing . Here is my solution : https://www.codechef.com/viewsolution/21248539 .

The recurrence that I thought is [ f(n,k) = f(n-j,k-j) for j=1 to (n-k+1) ] . base case: if n == k == 0 then i added the gcd of the newly formed array to the final answer.

Please someone explain how to solve this problem (or this type of problem) . ( I still don't know how to remove TLE. )

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

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

Автор damon2598, история, 6 лет назад, По-английски

in the educational Codeforces Round 53 , problem B (1073B) my solution gives TLE ,but I don't think it should. My submission is : http://codeforces.com/contest/1073/submission/44858358 can someone suggest the bugs in my code ,if any ?

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

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

Автор damon2598, история, 6 лет назад, По-английски

A very familiar niche of dp problemset is the subsequence problemset . But , there are a wide range of questions related to subarrays , that can be solved using dp. Please suggest me some resources for the problems related to subarrays , which can be solved using dp.

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

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