### 3905's blog

By 3905, history, 7 years ago,

Hello my submission for the problem http://codeforces.com/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.com/contest/691/submission/19745411 & other similar solutions are http://codeforces.com/contest/691/submission/19081882 & http://codeforces.com/contest/691/submission/19274092 & http://codeforces.com/contest/691/submission/19107997. Thanks!

• +1

By 3905, history, 8 years ago,

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?

• -3

By 3905, history, 8 years ago,

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 !

• 0

By 3905, history, 8 years ago,

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.

• -4

By 3905, history, 8 years ago,

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.

• +2

By 3905, history, 8 years ago,

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 .

• +27