Tameshk's blog

By Tameshk, history, 4 years ago, In English

Consider 16 non-empty sets each containing up to 2^16 numbers, which are between 0 to 2^16-1 inclusive and each number may appear in more than one sets, obviously. The goal is to find minimum number of numbers which we have at least one number from each set. I tried greedy approach, clearly is wrong, also have found general form of this problem which is np-complete. link Any comments would be highly appreciated.

Full text and comments »

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

By Tameshk, 4 years ago, In English

I want to invite you to share your template code which you're using for Codeforces contests using Carbon(free and open-sourse) project. Mine (First but not Best!):

Hope you guys take care in this time of corona-related hardship!

Full text and comments »

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

By Tameshk, history, 4 years ago, In English

Given two arrays A and B, find the number of different numbers can reach by adding exactly one element in A and exactly one form B. Constraints:|A|,|B| <= 2*10^5 0 <= A_i,B_i <= 2*10^5 No two elements in A and nor from B is same, However may be same numbers in A and B;
For example: A = [1,3,5] B = [1,3,7] ans = 6, [2,4,6,8,10,12]

Full text and comments »

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