deepkamal's blog

By deepkamal, history, 4 years ago, In English

So, I was looking at the editorial of 167E - Wizards and Bets, It askes us to find total number of simple paths from every node (with indegree zero) to every node (with outdegree zero). How do we solve this ?. Also can we solve for any given directed graph the total number of simple paths b/w every pair of nodes in polynomial time ?

Full text and comments »

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

By deepkamal, history, 4 years ago, In English

I was trying to solve this number theory problem from 2012-2013 ACM-ICPC, NEERC, Западный четвертьфинал. The problem name is L : sum. In this problem we given a number N and we want K(any K that works) natural numbers such that their sum is N and sum of their reciprocal is 1. How to solve this ? I tried various approaches but wasn't able to generalize for all N.

Full text and comments »

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

By deepkamal, history, 4 years ago, In English

I was solving this problem https://www.codechef.com/problems/COVERING and sort of came with a subproblem which I am not sure if it helps to solve the original problem but seems very interesting anyways.

Given an array A and array B with size (2^N) . Compute another array X of size (2^N) such that

X[mask] = sum of (A[i] * B[j]) such that ( (i&j) == mask ) .

How can one solve this for N <= 20 .

Full text and comments »

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

By deepkamal, history, 4 years ago, In English

I am implementing an ordered multiset but I am not able to erase elements from it . https://ideone.com/pnx4R3 From above code, after erasing the number of elements shown are same as without erasing .

Full text and comments »

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

By deepkamal, history, 4 years ago, In English

What are some strategies to give team contest during pandemic when team members are not present at a single location ?

Full text and comments »

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

By deepkamal, history, 4 years ago, In English

How to solve the following problem ? Given an array of size N having integer elements A[1], A[2] , …, A[N] find the maximum value of ( (A[1] xor X) + (A[2] xor X) + (A[3] xor X)+ … + (A[N-1] xor X) + (A[N] xor X) ) for some X belonging to [L,R] . constraints- N <= 100000, 1 <= A[i], L, R <= 1000000000 . A good follow up ques to try is https://www.codechef.com/problems/CHANDF

Full text and comments »

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

By deepkamal, history, 5 years ago, In English

I have been trying to solve this problem for a while now but made no progress. Can anybody help with TRENDGCD — Trending GCD at spoj.it is related to mobius function. here is link to the problem https://www.spoj.com/problems/TRENDGCD/

Full text and comments »

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