code_fille's blog

By code_fille, history, 9 years ago, In English
  • Vote: I like it
  • -16
  • Vote: I do not like it

By code_fille, history, 9 years ago, In English

Given an array of integers and a range find the count of subarrays whose sum lies in the given range. Do so in less than O(n^2) complexity.

Full text and comments »

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

By code_fille, history, 9 years ago, In English

Given a number n, how to perform atmost k swap operations on number's digits to get the largest number. Ex- n=7899, k=2 ans=9987

Full text and comments »

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

By code_fille, history, 10 years ago, In English

Given an array of 3 different colored balls, we have to sort it using minimum number of swaps. It could be done in O(n) using 3-pointers and two traversals(one to count no. of occurrences of each color and other to sort). Could this be implemented in one traversal(count is not known before).

Full text and comments »

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

By code_fille, 10 years ago, In English

Link to problem:- http://www.codechef.com/problems/SUBARRAY

Link to solution:- http://www.codechef.com/viewsolution/7071035 Can anyone tell me the testcase my code gives wrong output for.

Full text and comments »

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

By code_fille, 10 years ago, In English
int main() 
{
	//Beauty is in relaxed hard work.
	//SSGCA :)
	//Keep doing your thing, complexity would turn into simplicity! :)
    unsigned short int a=0xffff; 
    ~a;
    printf("%x",a);
	return 0;
}

Why does this program output 'ffff' and not 0000?

Full text and comments »

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

By code_fille, 10 years ago, In English

Hey, could anyone please share problems on codeforces based on vertex cover problem. Thanks :)

Full text and comments »

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

By code_fille, 10 years ago, In English
  • Vote: I like it
  • 0
  • Vote: I do not like it

By code_fille, 10 years ago, In English

Why do many programmers use assert() function in their codes giving as its argument the answer to be outputed?

Full text and comments »

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