## Search found 24 matches

Sun Sep 28, 2003 10:35 am
Forum: Volume 102 (10200-10299)
Topic: 10232 - Bit-wise Sequence
Replies: 12
Views: 4428
ok, let me put my code here, I'll be graceful if you could have a brief look at it : [pascal] program P10232; type Int=LongInt; var A:array [-1..31,-1..31] of Int; Bit:array [0..31] of Byte; function Solve(n:Int):Int; var i,b,k:Int; begin i:=0; while n>=0 do begin n:=n-A[31,i]; Inc(i); end; Dec(i); ...
Sun Sep 28, 2003 10:30 am
Forum: Volume 102 (10200-10299)
Topic: 10232 - Bit-wise Sequence
Replies: 12
Views: 4428
Thanks for your inputs Larry, but altough it can solve them in the right way, i got WA another time , I'm really getting disappointed of this problem

Shahab Tasharrofi
Sun Sep 28, 2003 8:53 am
Forum: Volume 102 (10200-10299)
Topic: 10232 - Bit-wise Sequence
Replies: 12
Views: 4428

### 10232 - Bit-wise sequence

Hi everybody,

I have solved the problem #10232, but I got WA for it. It solves the sample input and my samples in the right way and I really can't understand the problem behind it.

Can anyone give me some sample input and output plz?

Shahab Tasharrofi
Tue Sep 23, 2003 12:07 pm
Forum: Volume 102 (10200-10299)
Topic: 10228 - Star not a Tree?
Replies: 4
Views: 2680

### 10228 - Star not a Tree?

Any idea to solve such a problem, plz?

I have the idea of derivation of the sum of the distances, but it is really hard and unamusing to code.

Sun Mar 30, 2003 3:07 pm
Forum: Algorithms
Topic: A*?
Replies: 3
Views: 2525
hi, every body

i think that Nak must add this note that the A* is optimally efficient
it means that if u use an unit heuristic in some different algorithms including A*, the A* will use the minimum time to find it

Best regards,
Shahab Tasharrofi
Sun Mar 30, 2003 2:59 pm
Forum: Algorithms
Topic: Irrational Numbers p/q !!!
Replies: 11
Views: 3699
power series r 2 week for such works at first, u must know that we can not show all the functions with powe series like Maclaurin series, they have their limitation for ex, consider the following function. there is no power series to show such function f(x)= 1 if we have two integers p,q such that x...
Sun Mar 30, 2003 2:44 pm
Forum: Algorithms
Topic: Algorithm for intersecting lines
Replies: 3
Views: 2671
at first, u need an algorithm to determine whether a point is over a line or under it( u can do it using the line equation) i mean that if u have the line aX+bY+c=0 and also u have the point (x0,y0), if u replace the point in the equation the result of next expression "sign(a*x0+b*y0+c)" shows whete...
Sun Dec 29, 2002 8:56 am
Forum: Algorithms
Topic: How to generate unique permutation
Replies: 2
Views: 2823
As you know the if we have a(k) number of the kth element, and we have n elements, the number of permutations is like this: C(m,a(1))*C(m-a(1),a(2))*C(m-a(1)-a(2),a(3))*... where m represents the sum of a(i)s, and C(n,k)=(n!/(k!*(n-k)!)) If we number the permutations, using the above formula, we can...
Wed Dec 18, 2002 2:10 pm
Forum: Algorithms
Topic: Finding the heavier rectangle
Replies: 10
Views: 3986
Hi rfcotta, I think that your algorithm won't provide the rectangular shape of the answer, it just provides the connectivity of it ( but also it won't be the answer even for the connected numbers , I think ). for example , check your algorithm with the following matrix. -11 -11 -11 1 -11 -11 1 1 -11...
Sun Dec 01, 2002 8:56 am
Forum: Algorithms
Topic: How to solve binary search tree in O(n^2) ??
Replies: 2
Views: 2216
Hi, sir

Are you sure that there is one with O(n^2) or you're just trying find one ? Becuase I think that I must have heard about it if there's one.

And if you find one which its time complexity is lower than O(n^3), I would be happy to hear about that.

Thank you,
Shahab Tasharrofi
Sun Dec 01, 2002 8:31 am
Forum: Algorithms
Topic: A really really good book specialized on graph
Replies: 5
Views: 3330
hi, every body

I think the "Graph Theory" of the West is the best book. but I think it won't be free online.

Sincerely yours,
Shahab Tasharrofi
Sun Dec 01, 2002 7:10 am
Forum: Algorithms
Topic: Prime Factors !!!!!!
Replies: 12
Views: 5863
I found that article, you can find it at http://www.research.att.com/~shor/papers/QCjournal.ps ,in this paper there is a random method for factoring numbers, and it is not just for quantum computers. And Larry, you must read it too, i think. Becuase the Peter Shor ( Writer of this article ) claims t...
Sun Nov 24, 2002 11:29 am
Forum: Algorithms
Topic: difficult problem
Replies: 3
Views: 2475
Hi, nghiank

I can't understand your definition of the problem. Can you have some example matrices that satisfy this condition and that don't satisfy it?

Sincerely yours,
Shahab Tasharrofi
Sun Nov 24, 2002 11:15 am
Forum: Algorithms
Topic: Prime Factors !!!!!!
Replies: 12
Views: 5863
Hi everybody, Some monthes ago, I read about factoring integers in quantom computers, and I found a random method of factoring numbers(not only to primes) used in this algorithm, but it wasn't related to quantom computers. The time order of this method was very connected to the number of prime facto...
Sun Nov 24, 2002 10:46 am
Forum: Algorithms
Topic: I think it's a very hard problem
Replies: 2
Views: 2333