## Search found 17 matches

Tue Dec 20, 2005 9:03 pm
Forum: Algorithms
Replies: 4
Views: 3932
In worst case its works N*N*logN
Fri Nov 18, 2005 11:22 pm
Forum: Volume 109 (10900-10999)
Topic: 10972 - RevolC FaeLoN
Replies: 10
Views: 5272
Who may check this input 3 3 1 2 2 3 3 1 10 11 1 2 2 3 3 1 3 7 4 5 5 6 6 4 7 9 6 3 9 8 7 8 3 2 1 2 2 3 3 0 6 4 1 2 1 3 1 4 5 6 1 0 0 0 7 6 1 2 1 3 2 4 2 5 3 6 3 7 20 20 1 3 3 5 5 7 7 9 9 11 11 13 13 15 15 17 17 19 19 20 20 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 1 10 12 1 2 2 3 3 4 4 2 1 5 5 6...
Fri Sep 02, 2005 12:27 am
Forum: Volume 103 (10300-10399)
Topic: 10308 - Roads in the North
Replies: 30
Views: 9995
Dominik your algorithm is right (I got AC with same algorithm). In this algorithm only one intersting place: DFS(...){ int max1=0,max2=0,.....; ...... // cycle t=DFS(.....); if (t > max1){ max2=max1; max1=t; } else if (t > max2) max2=t; ....... // end cycle if (max1+max2 > max) max=max1+max2; return...
Wed Aug 31, 2005 11:35 pm
Forum: Volume 108 (10800-10899)
Topic: 10899 - Billiard again
Replies: 2
Views: 1767
Thank you very much Martin, i found my logical mistake (i think that length of path of ball is s*v, but i mistaken, length of path of ball is s*v/2) and got AC.
Wed Aug 31, 2005 10:05 pm
Forum: Volume 108 (10800-10899)
Topic: 10899 - Billiard again
Replies: 2
Views: 1767

### 10899 - Billiard again

Please help me. I have some questions about this problem. 1 Whats means this sentence "Before the first bounce, the ball increases its distance from the lower left corner of the table." 2 Initinally ball have coordinantes (a/2,b/2) (i think this coord of middle of table)? 3 (0,b) (a,b) -------------...
Tue Aug 30, 2005 10:36 pm
Forum: Volume 3 (300-399)
Topic: 302 - John's trip
Replies: 20
Views: 5035
Thank you very much mf.
I got AC.
Tue Aug 30, 2005 7:59 pm
Forum: Volume 3 (300-399)
Topic: 302 - John's trip
Replies: 20
Views: 5035

But why?

1 16 2 13 10 11 12 17 9 3 4 6 14 5 7 15 8

lexicographically smaller than

1 16 2 3 4 9 10 11 17 12 13 6 14 5 7 15 8.

If this sentence "... which finds the desired shortest round trip" means, that the path must have the smallest number of junction?
Tue Aug 30, 2005 4:37 pm
Forum: Volume 3 (300-399)
Topic: 302 - John's trip
Replies: 20
Views: 5035

### Problem 302

I got WA many times. Is my output for this test case is correct? 2 4 3 2 4 4 2 1 1 1 4 2 2 3 5 3 4 6 2 5 7 2 5 8 4 6 9 5 5 15 1 1 16 3 3 14 6 6 17 7 4 13 6 7 10 7 6 11 6 7 12 0 0 2 1 3 2 2 2 2 2 6 2 2 7 2 2 8 1 1 4 1 2 1 1 1 5 0 0 2 1 3 2 2 2 2 2 6 2 1 7 2 2 8 1 1 4 1 2 1 1 1 5 0 0 1 2 16 2 1 21 1 4...
Sun Aug 28, 2005 10:00 pm
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 38502
Try first to generate all primes < sqrt(2^31) and then instead "n mod i" use "n mod prime", where prime the next prime number
Sun Aug 28, 2005 6:57 pm
Forum: Volume 5 (500-599)
Topic: 543 - Goldbach's Conjecture
Replies: 109
Views: 25378
Your prime number generator very slow. this my code to generate prime numbers: int mas[100000],in; char matr[1000001]; int prost(){ int i,j,t; for (i=3;i<1000001;i+=2) if (!matr[i]){ mas[in++]=i; t=i+i; for (j=i;j<1000001;j+=t) matr[j]=1; } return 0; } this function generate all primes 2< < 1000001 ...
Tue Aug 16, 2005 5:40 pm
Forum: Volume 108 (10800-10899)
Topic: 10816 - Travel in Desert
Replies: 49
Views: 22867
Yes, you is right, but AC program must gives for this input right output.
Tue Aug 16, 2005 5:38 pm
Forum: Volume 108 (10800-10899)
Topic: 10842 - Traffic Flow
Replies: 17
Views: 9988
Thank you Martin for reply. You is right, i find bug in my code, and got AC.
Sun Aug 14, 2005 11:25 pm
Forum: Volume 8 (800-899)
Topic: 851 - Maze
Replies: 35
Views: 16716
This output for tests above west west south south east east south west west north north east east east west west west east east east east east west south south east east south south west west south west south west west south south west south east west west west north south north west west north east...
Sun Aug 14, 2005 1:47 pm
Forum: Volume 108 (10800-10899)
Topic: 10816 - Travel in Desert
Replies: 49
Views: 22867
Check this input: 20 19 1 11 1 20 3 3 20 2 78 34 2 19 78 3 19 3 78 3 3 18 78 5 18 4 1 23 4 17 1 23 17 5 1 1 5 16 1 1 16 6 2 23 6 15 34 3 15 7 35 3 7 14 2 23 14 8 78 3 8 13 24 2 13 9 3 34 9 12 2 1 12 10 34 3 10 11 3 34 20 19 1 20 1 2 3 53 2 3 35 35 3 4 23 3 4 5 7 7 5 6 34 2 6 7 11 6 7 8 24 1 8 9 2 23...
Sat Aug 13, 2005 8:38 pm
Forum: Volume 108 (10800-10899)
Topic: 10842 - Traffic Flow
Replies: 17
Views: 9988

### 10842 - Traffic Flow

Hi all,
I use to slove this problem MST and get WA all time.
If there are some bad inputs for this problem or I mistake with choose algoritm???