tIt looks like a pretty trivial task, yet I only pass first half of test cases. And many failed during the contest as well.
What are the hidden tricks?
pCheck everything. If there is two ')' at the end, after POLYGON, if it says POLYGON and not something else, if there is more than 3 points, if the first and last one are the same, intervals etc.
tThanks for reply. If that is actually the case, I think the problem statement is wrong or at least very deceptive.
It starts with "You are given a polygon in the following (well known) text format (WKT): POLYGON ((x1 y1, x2 y2, x3 y3, ... , xN yN)), where x1 y1 and xN yN are equal (represent the same point), and N>3." This sentence implies that the format won't be corrupt in any way and that contestants can assume:
- inputs will stick to that format
- last and first points will be the same (even example is wrong here)
- N>3
nI agree with thocevar, the task was not described well.... I understood that it would always be "POLYGON((3 points))" and it would be stupid to check that... :S And I have got one more annotation, the two tasks were added too late during the competition. Competition should last 7 days, and 2 days before the competition ended my friend tells me there is one more task, and somehow I wrote it... But tomorrow (not sure ;) ), my friend tells me that there is one more task added (I don't have internet because I go to school in another town)... and then the time of the competition is increased for 2 days.... And I was unable to do the tasks :( But nvm... So input of WKTPoligon (task) can be anything not just the WKTP format???
pYes, you have to check if its in WKT format.
mI agree thocevar..
If the statement is "You are given a polygon in the following (well known) text format (WKT): POLYGON ((x1 y1, x2 y2, x3 y3, ... , xN yN))", then I think we can conclude that you are given a polygon in the following (well known) text format... It's logical. But, now, we cannot do anything since the contest's already ended.