## Search found 25 matches

Sun Oct 07, 2007 12:05 pm
Forum: Volume 113 (11300-11399)
Topic: 11307 - Alternative Arborescence
Replies: 22
Views: 11207
You may find this O(n) algorithm interesting (no need to know how many color there are).
http://citeseer.ist.psu.edu/494676.html
Sun Oct 07, 2007 12:02 pm
Forum: Volume 112 (11200-11299)
Topic: 11293 - Tournament
Replies: 19
Views: 6822
Thanks. I got it.
Fri Oct 05, 2007 4:37 pm
Forum: Volume 112 (11200-11299)
Topic: 11293 - Tournament
Replies: 19
Views: 6822
How do you prove the greedy is always correct?
Fri Oct 05, 2007 4:34 pm
Forum: Volume 112 (11200-11299)
Topic: 11294 - Wedding
Replies: 21
Views: 9029
Yes, you are right. My AC output is the same as yours.
Tue Oct 02, 2007 3:32 pm
Forum: Volume 113 (11300-11399)
Topic: 11300 - Spreading the Wealth
Replies: 14
Views: 5783
I used a nlogn algorithm for finding median. Is there any better algorithm?
Tue Oct 02, 2007 7:42 am
Forum: Volume 113 (11300-11399)
Topic: 11302 - Hexadecimal Digits of an Integral
Replies: 10
Views: 2898
AC Finally. Thank you all. Just "guess" the constant.
Mon Oct 01, 2007 3:38 pm
Forum: Volume 113 (11300-11399)
Topic: 11302 - Hexadecimal Digits of an Integral
Replies: 10
Views: 2898
The first product is ln2 but i still don't know what is the value of ln(1+x^2)/(x+1)dx
Mon Oct 01, 2007 12:02 pm
Forum: Volume 112 (11200-11299)
Topic: 11298 - Dissecting a Hexagon
Replies: 25
Views: 8606
I read a paper and it said that :
For a n-gon (n>=5), there is no way to dissect it into m triangles with equal area with gcd(n,m)=1.
Mon Oct 01, 2007 6:13 am
Forum: Volume 112 (11200-11299)
Topic: 11298 - Dissecting a Hexagon
Replies: 25
Views: 8606
AC now after using string to read input!!!
Sat Sep 29, 2007 2:12 am
Forum: Volume 107 (10700-10799)
Topic: 10749 - Automobile Travelling
Replies: 9
Views: 5310
My output has the same number of moves as your output. Could you please check what's wrong with my code : #include <iostream> #define MAXK 1005 #define MAXP 15 #define MAXQ 15 using namespace std; int m,n,k,p,q,x0,y0,k0; bool c[MAXK][MAXK]; int pq[MAXK*(MAXP+1)*(2*MAXQ+1)*3]; int d[MAXK],a[MAXK]; in...
Fri Sep 28, 2007 3:17 pm
Forum: Volume 107 (10700-10799)
Topic: 10749 - Automobile Travelling
Replies: 9
Views: 5310

### Help me! plz

Could someone give me the output for this input? 20 31 31 9 4 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 ...
Wed Sep 26, 2007 5:31 am
Forum: Volume 112 (11200-11299)
Topic: 11287 - Pseudoprime Numbers
Replies: 11
Views: 5230
In the case where n is odd, it should be :

Code: Select all

``return (square(BigMod(a, n/2, p))%p)*(a % p) % p; ``
Tue Sep 18, 2007 3:43 pm
Forum: Volume 112 (11200-11299)
Topic: 11281 - Triangular Pegs in Round Holes
Replies: 26
Views: 11260
i change your program to compute the condition for all 3 edges of the triangle and it got AC: bool valid(double a, double b, double c, double d){ double theta, alpha, eta, xx; if( a - d > eps ) return false ; theta = acos( ( a*a + b*b - c*c )/(2*a*b) ) ; alpha = acos( a/d ); // since D[j] = 2*r ; et...
Tue Sep 18, 2007 1:03 am
Forum: Volume 112 (11200-11299)
Topic: 11280 - Flying to Fredericton
Replies: 43
Views: 16947

Code: Select all

``dp(x,y) = min{dp(x,y), dp(i, y-1)+cost(i,x)}; ``
It's the same as my AC code and i only considers flight (i,j) where i<j.
Tue Sep 18, 2007 12:57 am
Forum: Volume 112 (11200-11299)
Topic: 11281 - Triangular Pegs in Round Holes
Replies: 26
Views: 11260
theta = acos( ( a*a + b*b - c*c )/(2*a*b) ) ; alpha = acos( a/D[j] ); // since D[j] = 2*r ; I believe that you have used the wrong angle. I used this one theta = acos( ( a*a + b*b - c*c )/(2*a*b) ) ; alpha = asin(c/D[j] ); if (alpha-theta>-eps) ... And you used it for all 3 edges of the triangle.[/...