Unofficial Editorials February Long Challenge (Part - 2)

Thanks @vijju123

@vijju123 can you please correct me where i m wrong

Thank you

It seems surprisingly fine to me. Can you code the same and submit in C++? To rule out any language difference in this.

@xerefic can u make ur method more clear

what actually u did

Yeah, but long is necessary only when I add more than 3 coordinates as Each coordinate is <10^9 which comes inside int. So it is sufficient to put Long long for temp1, temp2

Basically, I segregated the corrdinates into 9 types depending on the values mod 3,sk that I can guarantee that the triangle formed by three points will have its centroid as a lattice point. So I used pos[x%3][y%3]=make_pair(x,y).and iterated through the vector and found the centroid.

1 Like

@shubhu1596 I know this solution should not get AC but see that user is using midpoint formula of the line segment.Because there are n/2 lines, he could get n/10 points easily!

Well, My approach was to use O(N^3) brute force algorithm, coupled with a few observations, one being the same as official editorial. (Regarding Number of divisors)

Iā€™ll try to post if i can, but no promise.

PS: Sorry for late reply

Yes, I even had more WAs on this problem alone than all other problems combined for this contest.

Only last day i used Modular Inverse that did the trick.

Maybe the excessive use of mod in block where t%2 != 1.

Canā€™t be sure because Iā€™m not versed in python.

Yes, it can be labelled as easy-medium, If you get the obersvation.

One of my friend, rather better at coding than I am, didnā€™t even attempt this problem but solved all others (Partial in lucas, rest all 100). Only reason: He didnā€™t get these observations (due to geometry).

Thatā€™s why i labelled it medium problem.

See the hidden part in editorial and read about modular multiplicative inverse.

Well, I had so many WAs in POINTPOLY trying to get the 30 point subtask- so many that I was afraid I will cross the 500 submission limit XD

For POINPOLY, i got 100 points in one go.

Frankly, i try to make as less submissions as possible. Otherwise, in longs of 2017, many problems had near 50 submissions of mine, with really minor differences (never reached 100 i guess).

Itā€™s too an achievement, achieved by only a few :wink:

@cis_pie what about those cases in which the mid point of such chords are same, the code does not even checks for such duplicate points

Soā€¦looks like I am the only one who made 0 observations and crashed the party with rand() XDDDD I solved this Q only because rand() got me 70 points :3

There might be other users too, still in shadows, remaining masked unlike you. :wink:

remaining masked unlike you

Ironically, in real life I prefer remaining masked. I just dont like any kind of spotlight lol.

It's too an achievement, achieved by only a few ;)

Trueā€¦but I still wont prefer it in Cook-offs :stuck_out_tongue: :3

Probably that N=10 case was the trump card :stuck_out_tongue: and should have been included for 70 pts case also as a lot of random techniques passed for 70 pts.