3905's blog

By 3905, history, 8 years ago, In English

Hello my submission for the problem http://codeforces.net/problemset/problem/691/D gets MLE while I have seen similar solutions getting passed using lesser memory.Can someone explain what is the reason behind it. My submission http://codeforces.net/contest/691/submission/19745411 & other similar solutions are http://codeforces.net/contest/691/submission/19081882 & http://codeforces.net/contest/691/submission/19274092 & http://codeforces.net/contest/691/submission/19107997. Thanks!

Full text and comments »

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

By 3905, history, 9 years ago, In English

You are given N numbers and you have to determine total possible ways to arrange them such that N1 < N2 > N3 < N4 > N5 < N6 > N7....so on.N1,N2 are the numbers of the list.The interviewer didn't specify the constraints and asked instead for best possible solution.How to solve it?

Full text and comments »

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

By 3905, history, 9 years ago, In English

Google search just says that execution time is proportional to certainty with the relation that (1 — 1/2^certainity) is less than actual probability of returning a prime but no explicit formula is mentioned ! It would be great if someone can tell that! Thank you !

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By 3905, history, 9 years ago, In English

Hello my submission here gives WA on test 3 due to precision issues.My question is how to detect playing with doubles would give a WA.Because there are many instances I recall where intended solution was to manipulate with doubles but still there was no precision errors unlike this case.So if someone can help me it would be great.And yeah in above solution I am trying to find all the coordinates first (0,0) & (a1,0) being the first two and then remaining coordinates and then using the standard way of finding area of triangle if coordinates are given.

Full text and comments »

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

By 3905, history, 9 years ago, In English

I was trying to solve this problem .I read the editorial here but I am unable to figure out why C(i) = sum of C(j) just on the property that C(i) is in between 0 & M — 1 && that M divides (C(i) — sum of C(j)). If someone can help it will be highly appreciated. Thanx.

Full text and comments »

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

By 3905, history, 9 years ago, In English

Can someone please explain the suffix automaton algorithm as I have read from all possible sources but still no clue. And also what does this algorithm give (I mean like in suffix array it is sorted suffixes of string).Also is Finite Automata same as suffix automaton.If no please can you mention the purpose of FA. I understood its algorithm but _ am unable to get its intuition and the purpose it's used.If someone can explain, I'll be highly obliged._ I know this is lot of work to explain but you can downvote the post if you like but please explain. Thanx .

Full text and comments »

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