|
|
I think this test should break some AC solutions: 443 -39 457 33 386 -773 561 127 Correct answer is -1, but I think some AC solutions can print 0 1. Use integer calculation for judging if the answer is -1 or 0. 2. Use integer calculation until the last step for the area (an integer-division). 3. Use 'long long' instead of 'long' or 'int'. Also, here are some cases which might help. 0 0 -1000 0 0 0 1000 1 1000001000.000000 -1000 0 0 1000 0 -1000 1000 -999 2002004004.004004 0 400 1000 1000 -1000 -1000 355 -187 -1 0 400 1000 1000 -1000 -1000 350 -190 0 0 400 1000 1000 -1000 -1000 353 -188 16931680400.000000 -1000 -1000 1000 1000 -1000 -1000 1000 999 31984004000.000000 -1000 -1000 1000 1000 -472 -851 379 1 5800420000.000000 More tricky cases: 0 0 3 0 1 0 1 0 0 The following testcase helps me to beat WA#33. 0 0 3 0 0 1 3 1 -1 Edited by author 27.11.2012 17:54 Edited by author 27.11.2012 17:54 Edited by author 27.11.2012 17:54 This test shouldn't be applied: 0 0 3 0 1 0 1 0 0 because it is said that window lengths are positive. And that's true, I've checked. Or maybe a misprint? -1000 0 0 1000 0 -1000 1000 -999 2002004004.004004 i get 2002004.0040040, but accepted. Same here, also another test is incorrect. All others are fine. -1000 0 0 1000 0 -1000 1000 -999 2002004.00400400 0 400 1000 1000 -1000 -1000 353 -188 16931680400.00000000 Since input numbers are integers, pseudovector product absolute value will be at least 1 if they aren't parallel, so you can compare it to 0.5 to have bigger margin for double precision error. Just get cross-product (dx1*dy2-dx2*dy1). If it's zero - they are parallel. Edited by author 16.06.2021 15:21 Edited by author 16.06.2021 15:22 The geo looks simple. But fail at WA#10. :( oops. Stupid error =) Edited by author 29.11.2014 13:03 Can you, please, tell me, what was wrong in your programm, because I can't find the bug -_- never mind, it was really stupid mistake) Edited by author 03.02.2016 19:38 Edited by author 03.02.2016 19:38 443 -39 457 33 386 -773 561 127 Correct answer: -1 check your solution for this case: 0 0 1 0 0 1 1 1 answer is -1. what answer for this test: 0 0 1 0 1 1 2 1 0 or -1 ? 0, cause a line doesn't have the area. each window light travels in both directions, or one? Don't use int. Use long long. Edited by author 31.10.2012 15:46 |
|
|