Search found 63 matches

Tue Jul 25, 2006 5:55 pm
Forum: Volume 110 (11000-11099)
Topic: 11053 - Flavius Josephus Reloaded
Replies: 22
Views: 10890
Ok, thanks.
Tue Jul 25, 2006 10:52 am
Forum: Volume 110 (11000-11099)
Topic: 11053 - Flavius Josephus Reloaded
Replies: 22
Views: 10890
As I understand, after I find situation: pointers are at one position, I need start to count and wait for second occurency such event.
This will truly period of a cycle.
Tue Jul 25, 2006 10:39 am
Forum: Volume 110 (11000-11099)
Topic: 11053 - Flavius Josephus Reloaded
Replies: 22
Views: 10890
What will be if the set has a long tail ? For example, 1 2 3 4 5 6 7 5 6 7 5 6 7 5 6 7 .... and so on When we use Rho method it'll get incorrect result. F - first pointer S - second one T - step number F | S | T 2 3 1 3 5 2 4 7 3 5 5 4 So we have cycle of length 4 .... may be I don't understand some ?
Mon Oct 10, 2005 3:23 am
Forum: Volume 109 (10900-10999)
Topic: 10932 - Calculator
Replies: 19
Views: 11338
Try this example:

Code: Select all

``````((1+2))
``````
Sun Oct 09, 2005 1:25 pm
Forum: Volume 109 (10900-10999)
Topic: 10932 - Calculator
Replies: 19
Views: 11338
There are no negative integers in input. For all calculation I used long double and got AC.
Mon Jul 04, 2005 7:13 am
Forum: Volume 108 (10800-10899)
Topic: 10873 - Splat, Inc.
Replies: 7
Views: 2247
ardiankp Yes, you're right. It is my missing. Now I got AC.
Thank you !
Wed Jun 29, 2005 11:03 am
Forum: Volume 108 (10800-10899)
Topic: 10873 - Splat, Inc.
Replies: 7
Views: 2247
I handled both of this case. May be I didn't understand description of problem clearly. Let me present part of my code: int mas[52][52]; int n,m; void dropball (int x); void checkit (int y,int x) { if (y+2>=m || (mas[y+2][x-1] && mas[y+2][x+1]))return; mas[y][x]=0; if (!mas[y+2][x-1] && !mas[y+2][x+...
Wed Jun 29, 2005 3:48 am
Forum: Volume 108 (10800-10899)
Topic: 10873 - Splat, Inc.
Replies: 7
Views: 2247

10873 - Tricky cases

Hi !

Are there exists some tricky cases ?
I think my program works fine, but it got WA everytime.
Tue Jun 28, 2005 9:23 am
Forum: Volume 108 (10800-10899)
Topic: 10871 - Primed Subsequence
Replies: 20
Views: 12394
If upper bound will be 10000 and amount of numbers is 10000 than
N*B = 10^8. If we use bit sieve of Erathosphenes it take us 12,5 Mb and
complexity O(10^8*log(10^8)). What do you think about it ?
Wed Nov 03, 2004 12:02 pm
Forum: Volume 107 (10700-10799)
Topic: 10750 - Beautiful Points
Replies: 21
Views: 13126
I used a (hopefully) correct implementation of the O(n log n) divide-and-conquer algorithm, got AC in the contest. As Krzysztof said, you can read about it in CLR. Or it shouldn't be too hard to find a page describing it, if you search for closest pair. Yeah, thanks. I tried to find CLR but its siz...
Tue Nov 02, 2004 12:18 pm
Forum: Volume 107 (10700-10799)
Topic: 10750 - Beautiful Points
Replies: 21
Views: 13126
If you use that kind of algo and you got AC, then judge data is incomplete. Don't be so surprised. Big cases are often random generated, so one can achieve good time making some assumptions that usually, but not always, hold. What about correct algo ? Does every people (who got AC in online contest...
Tue Nov 02, 2004 8:05 am
Forum: Volume 107 (10700-10799)
Topic: 10750 - Beautiful Points
Replies: 21
Views: 13126
The reason behind my code being very fast is that I have used the wrong algorithm and that takes O(NlogN) time. I mean I have used this one: For each point P , check all the points from P[i-1] to its left until the distance of P ->P[j] is more than dist of P ->p[j+1]. I have no idea how it worked a...
Mon Nov 01, 2004 4:19 pm
Forum: Volume 107 (10700-10799)
Topic: 10750 - Beautiful Points
Replies: 21
Views: 13126
Believe it or not... the method I used got AC. .. and my program was completly wrong. My program produces the wrong output for the case rootZOOM mentioned. Here goes the correct algo: ( hopefully ) sort all the points wrt x first then y. then for each point P check all the points to its left until ...
Mon Nov 01, 2004 12:29 pm
Forum: Volume 107 (10700-10799)
Topic: 10750 - Beautiful Points
Replies: 21
Views: 13126
What does CRL means The book by Cormen, Rivest, Leiserson. A must-read. For each point P , check all the points from P[i-1] to its left until the distance of P ->P[j] is more than dist of P ->p[j+1]. Although it might look to be a n^2 algo but invariably the second loop terminates early Not only th...
Mon Nov 01, 2004 7:40 am
Forum: Volume 107 (10700-10799)
Topic: 10750 - Beautiful Points
Replies: 21
Views: 13126
Can you explain in more detail your second point. I thought about sorting, but I didn't understand what to do in further. ) Here it goes: For each point P , check all the points from P[i-1] to its left until the distance of P ->P[j] is more than dist of P ->p[j+1]. Although it might look to be a n^...