Show all threads Hide all threads Show all messages Hide all messages |
If you are too lazy to solve it yourself read that spoiler (deterministic algo) | Mahilewets | 1333. Genie Bomber 2 | 31 May 2017 12:26 | 1 |
You can just brute force all possible points on the grid. For every point check whether that point is under attack. So, your grid is just a SZ*SZ square matrix. SZ=200 is accurate enough, and even somewhat smaller values are OK. |
I got AC(0.046s) by random algorithm. Any other algorithms? | OIdiot | 1333. Genie Bomber 2 | 28 Feb 2015 13:34 | 1 |
What about Simpson integration ? please. |
Doubts about using the random number. | MYLS | 1333. Genie Bomber 2 | 1 Aug 2014 12:29 | 3 |
In my programme, I use 1000 000 random locations to check if the points are in the circle. At first, I wrote something like this: "double tx = ( double )( rand() % 101 ) / 100.0 ";(because: 0 ≤ x ≤ 1, -> rand() % 101 ∈[ 0, 100 ] );and just got WA...... Finally I changed the 101 into 100 and got AC; Can anyone tell me why 101 is incorrect? or it is actually right? You're just lucky that in the second case you got AC - actually good tests will kill your second solution as well, because what you generate is random point on integer grid 100 x 100 and this is far from random real point. Good way of generating random point in unit square is doing double(rand()) / RAND_MAX for both coordinates - this will give you point close enough to truly random. Thanks for your reply, I realize I have mixed up continuity and dispersion. :-) |
Test#10 OR Can it be solved with monte carlo alogrithm? | Alex Svetkin [OrelSTU] | 1333. Genie Bomber 2 | 30 Jul 2013 20:24 | 6 |
Can it be solved with monte carlo alogrithm? I used 10^6 points for checking and got WA at test #10. Then changed number of points to 10^5 and still get WA#10. Edited by author 19.10.2004 02:09 I cut the square into 10^5 stripes and WA #10. Then I magnified the picture by 10^4 times and changed real into extended, WA #10 still. Wrong test, or wrong algo? I used 10^6 points checking and I got AC=) Try to post your code I'm sure the problem there I've solved it with monte carlo alogrithm. So, i can say that it is possible |
Help, please! | Anuar | 1333. Genie Bomber 2 | 26 Oct 2011 15:15 | 1 |
please, tell me how to solve this problem. I can't find right solution to this problem. |
WTF? | MOPDOBOPOT (USU) | 1333. Genie Bomber 2 | 15 Dec 2010 20:03 | 3 |
WTF? MOPDOBOPOT (USU) 13 Dec 2010 20:26 2 0.2 0.2 0.5 0.8 0.8 0.5 My accepted program returns 81, but the answer from statement is 80... "Precision of the result is required to be 1% or better." So answer 81 is OK. Re: WTF? MOPDOBOPOT (USU) 15 Dec 2010 20:03 Oh, OK! It's my permanent problem - don't reaв the statement. |
WA #4.Can somebody help me? [Solved] | Leonid (SLenik) Andrievskiy | 1333. Genie Bomber 2 | 28 Aug 2010 04:40 | 2 |
I'm using pure Monte-Carlo method. Here is my code (C#): [Code deleted by author] I've found my bug... P.S. For the pure Monte-Carlo method it is enough 10^5 points and Double type. Edited by author 13.06.2010 19:25 100 * 100 pts are enough. |
WhyCrash (floating-point invalid operation) test #10? | Neizvestnii | 1333. Genie Bomber 2 | 17 May 2007 18:07 | 1 |
Sorry, I have AC! Edited by author 18.05.2007 17:10 Edited by author 18.05.2007 17:11 |
Can anybody help me? I had WA#7 Look at my code: | Roma Labish[Lviv NU] | 1333. Genie Bomber 2 | 28 Jan 2007 02:44 | 4 |
[code deleted] Edited by author 28.01.2007 02:44 It was really hard to understand your prog for me:) (use pascal:) try this test 0 Thank's a lot!!! I've got AC!!! But how I can to optimize my program? (My time 0.213) :) Now I've got AC in 0.015 :) Thank's for help!!! |
AC in 0.046 =) | ronobe (aka oberon) | 1333. Genie Bomber 2 | 5 Oct 2006 21:20 | 4 |
Me too =) ronobe (aka oberon) 7 Mar 2005 15:42 779321 15:38:34 7 мар 2005 ronobe (aka oberon) 1333 C++ Accepted 0.015 107 КБ The time and exectness can be changed by one constant. In first AC submission it was 100000. In three next submissions this constant was lowered to 10000, 1000, 100 and I got AC too in 0.015... that's boring. AC - is most wanted. Not in this problem... Edited by author 05.10.2006 21:29 Edited by author 05.10.2006 21:29 |
Почему нет сэмпла??? | Sergeyev Alexander | 1333. Genie Bomber 2 | 5 Oct 2006 21:16 | 2 |
С какой точностью выводить? One persent as written ;D |
How to solve this problem? | HybridTheory | 1333. Genie Bomber 2 | 8 Jan 2006 10:33 | 11 |
Could anybody tell me the detail? Yeah,but how to present a circle? My program: count = 0; for X from 0.000 to 1.000 for Y from 0.000 to 1.000 if Point(X,Y) within some cirle then count := count+1 write(count/1000000*100); Simplest solution: O(1000^2) works 0.39 seconds. Hello! Aydarkanov Tair OKTL 8 Jan 2006 10:27 Hello! Aydarkanov Tair OKTL 8 Jan 2006 10:33 Why your name is Hybrid Theory? It's one of Linkin Park's albums(2000) Do you like Linkin Park? If you like it, then write me: \\tair_a@mail.ru \\fred007@mail.ru |
What are the limitations for N? I think they must be written! | Yaroslavtsev Grigory | 1333. Genie Bomber 2 | 18 Oct 2004 09:06 | 2 |
N <= 10 Vladimir Yakovlev (USU) 18 Oct 2004 09:06 |
Wrong tries | Orenburg SU 2 | 1333. Genie Bomber 2 | 16 Oct 2004 16:17 | 1 |
Why we now have 10 tries instead of 5 as was before rejudging? |
Test #4 is incorrect! (+) | Dmitry 'Diman_YES' Kovalioff | 1333. Genie Bomber 2 | 16 Oct 2004 15:54 | 5 |
It contains only one digit - and this digit is 0, so n=0, so what should I output? I've tryed '0', '0.25' ,..., '2', '3', '4', '5', '6', '10', '99', '100', 'No solution', 'No', 'no', '0%', '0.00', '-1'... Nothing helps. What's wrong? Why do you think that test number 4 contains only zero (0)? Edited by author 16.10.2004 16:20 <font color=#FF0000> ASD </font> |