Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

codolove's blog

By codolove, history, 4 years ago, ,

I was trying to solve Another Problem On Strings using two pointers since it was mentioned in its tags but I am not getting an idea of it. I have solved it by using hashing and binary search by considering the prefix sum. It will be helpful if one can give some idea of approaching it with two pointers.

• +3

By codolove, history, 4 years ago, ,

I was trying to solve this problem on spoj that involves LCS with some other constraints. I have come with a recursive solution which gives correct answer on all cases. But when I try to memoziate it, it gives wrong answer. I am not able to figure out why it gives wrong answer on memoziation. my code is here with explanation.

• 0

By codolove, history, 5 years ago, ,

I am trying to solve this on spoj. I have first precomputed the index for both the case(appending number to beginning and appending number to end). Then, I used top down approach to find the minimum value. It works on most test cases but gives wrong answer on spoj. I am not able to figure out the reason. Please help. My Soloution

• 0

By codolove, 5 years ago, ,

Problem I am trying to solve this problem by finding the region to which x or y belong. I am maintaining a set of all the regions that are available. First, I find to which set x or y belong and delete that set. Two new sets are created. I am keeping the "cut distance" in a set container. But I am getting TLE on test case 11. I ma using only logarithmic data structures. My Code

• 0

By codolove, 5 years ago, ,

I am trying to create a link list. I wanted to know how these two codes are different? Code1: if (start == NULL) { start = newnode; } else { temp = start; while(temp != NULL) { temp = temp->next; }

temp = newnode;

}

Code2: if (start == NULL) { start = newnode; } else { temp = start; while(temp->next != NULL) { temp = temp->next; }

temp->next = newnode;
}

}

• +6

By codolove, 5 years ago, ,

I am trying to solve this problem on spoj where we have to output those words which have a certain prefix in it. I used trie data structure for it. But I am getting wrong answer again and again. My solution is here.

• 0

By codolove, 5 years ago, ,

I was trying to apply the divide and conquer algorithm for closest pair of points on this problem. I have been getting wrong answer many times. My solution is here. I read this algorith from this site.

• +6

By codolove, 5 years ago, ,

I am trying to solve this question from many days but getting wrong answe always. I am using a trie to solve this. My code is here.