They had more N=10 cases in the 70 point subtask. Thing is, the deadliest one wasnt the one they expected- the 30 point one turned out to be deadlier than rest.
But still, "Brute force for N \le100 and apply the “random technique” for other N would still pass. So, its ok. 70 points turned out to be boaster for people tbh :3
Thanks! @taran_1407 got that part.(Thanks to MITOCW)
But can you please tell how you formed the matrix for cos(nx),
means why f[0][0] = 2v and f[0][1] = MOD-1 (why even that -1)
and that return part??
func()
{
…
1. F = new long[][]{{2v,MOD-1},{1,0}};
2. M = new long[][]{{2*v,MOD-1}, {1,0}};
3. power(N-1);
4. return mod(F[0][0]*v+F[0][1]);
}
And i am assuming that your power function works in the same manner, the power() and multiply() of method 4 of Program for Fibonacci numbers - GeeksforGeeks
Since I am a moderator, I cannot be masked lol. Else who will people go to resolve queries? XD People will be like “And the legend says that there is some strange force- called a moderator- which looks after the forums. Unseen to the eye, nobody has ever seen or heard any of him” XDXD
Read comments there. The code and procedure given at geeksforgeeks for point inside a polygon is incorrect. I know because I had to write an editorial, and that thing failed on edge cases.