|
|
Show all threads Hide all threads Show all messages Hide all messages | Hints for WA users. | 198808xc | 1927. Herbs and Magic | 17 Aug 2022 05:41 | 6 | 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 | Hint for checking if two segments are parallel | PrankMaN | 1927. Herbs and Magic | 17 Aug 2022 05:31 | 2 | 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. | WA#4 | Shohruh | 1927. Herbs and Magic | 16 Jun 2021 15:08 | 1 | WA#4 Shohruh 16 Jun 2021 15:08 Edited by author 16.06.2021 15:21 Edited by author 16.06.2021 15:22 | WA#10 | Ade [FDU] | 1927. Herbs and Magic | 3 Feb 2016 19:20 | 2 | WA#10 Ade [FDU] 29 Nov 2014 12:58 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 | WA 8 | pmartynov | 1927. Herbs and Magic | 7 Apr 2015 17:01 | 1 | WA 8 pmartynov 7 Apr 2015 17:01 443 -39 457 33 386 -773 561 127 Correct answer: -1 | if you have WA33 | Giorgi Giglemiani [Freeuni] | 1927. Herbs and Magic | 22 Feb 2013 08:37 | 1 | check your solution for this case: 0 0 1 0 0 1 1 1 answer is -1. | what answer? | Vit Demidenko | 1927. Herbs and Magic | 14 Dec 2012 09:13 | 2 | 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. | Window light | SHIRINKIN | 1927. Herbs and Magic | 1 Nov 2012 18:23 | 2 | each window light travels in both directions, or one? | WA23 | IgorKoval(from Pskov) | 1927. Herbs and Magic | 31 Oct 2012 15:45 | 1 | WA23 IgorKoval(from Pskov) 31 Oct 2012 15:45 Don't use int. Use long long. Edited by author 31.10.2012 15:46 |
|
|
|