
Search found 38 matches
- Thu Oct 12, 2006 9:52 am
- Forum: Volume 102 (10200-10299)
- Topic: 10219 - Find the ways !
- Replies: 33
- Views: 10328
What is the Range
Can anyone tell me the maximum value for n??????? 

- Tue Sep 19, 2006 7:15 am
- Forum: Volume 110 (11000-11099)
- Topic: 11088 - End up with More Teams
- Replies: 30
- Views: 17536
Among all pairs with minimum sum of values I always take the one with minimum first element. So my code passes your test case. It fails this test case: 7 2 4 6 6 7 9 9 Your greedy would choose 9,2,9 as the first team, and wouldn't be able to make a second team. But When there are 7 persons, I know ...
- Fri Sep 15, 2006 8:35 am
- Forum: Volume 105 (10500-10599)
- Topic: 10550 - Combination Lock
- Replies: 24
- Views: 20715
as soyoja wrote: Quote: The only trick of this problem is distinguish between clockwise and counter-clocwise. Counting angle for clockwise is (start point) - ( end point ) Counting angle for counter clockwise is (end point) - (start point ) i know, in above way the problem will be accecpted but i d...
- Mon Aug 28, 2006 2:24 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11061 - Playing War
- Replies: 41
- Views: 10642
- Wed Aug 23, 2006 2:23 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11061 - Playing War
- Replies: 41
- Views: 10642
- Tue Aug 22, 2006 1:19 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11061 - Playing War
- Replies: 41
- Views: 10642
You cannot use all your army in attack. Read When attacking, at least one army must remain on the origin territory, so a player with 3 armies can only use 2 of them to attack an adjacent territory. The defense, however, can use all the available number of armies to defend, up to a maximum allowed nu...
- Mon Aug 21, 2006 1:54 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10930 - A-Sequence
- Replies: 102
- Views: 32094
altaf hussain(sust_2002) wrote: for( j=0 ; j < num ; j++ ) {
if( array[j] != 0 ) {
sum = num + j ;
array[ sum ]++ ;
}
}
}
}
Still problem here. Try
Code: Select all
1 6 8 10 25
- Mon Aug 21, 2006 12:39 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10930 - A-Sequence
- Replies: 102
- Views: 32094
altaf hussain(sust_2002) wrote:
for( i = 0 ; i<n ; i++){
array[ num ]++;
for( j=0 ; j < num ; j++ ) {
if( array[j] != 0 ) {
sum = num + j ;
array[ sum ]++ ;
}
}
}
}
I think this doesn't work correctly. Try the input:
Code: Select all
5 1 6 8 10 12
- Mon Aug 21, 2006 12:20 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11065 - A Gentlemen's Agreement
- Replies: 19
- Views: 8725
- Mon Aug 21, 2006 12:00 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10930 - A-Sequence
- Replies: 102
- Views: 32094
- Sun Aug 20, 2006 5:52 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11061 - Playing War
- Replies: 41
- Views: 10642
I think now I understand the problem. I had some wrong idea. But now I have same kind of problem. My code outputs 172 for 100. for 171 the probability is 0.4986... Most of the outputs matches. I have used: p(m,n)=p1*p(m,n-3)+p2*(m-1,n-2)+p3*(m-2,n-1)+p4*(m-3,n) where p1=6420.0/46656.0; p2=10017.0/46...
- Sat Aug 19, 2006 2:56 pm
- Forum: Volume 5 (500-599)
- Topic: 574 - Sum It Up
- Replies: 46
- Views: 14014
Re: Help On 574
Hi kodder I have found your problem.Your code fails to give the correct output to the following input. Input: 4 0 6 0 Your program terminates here while the correct output is: Sums of 4: NONE Sums of 6: NONE I don't think that is the case. Because when n==0 the program should terminate: If n = 0 it...
- Sat Aug 19, 2006 12:28 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11073 - Euler's Totient Function
- Replies: 20
- Views: 6715
well... in my process i had written PRIME() function which returns 0/1 according to whether it is prime or not when i need to check primality for a number > sqrt(10^9) but no one here mentioned for such process. so am i doing inefficient some where? You can use 3*10^7 size char array for flagging, ...
- Sat Aug 19, 2006 8:54 am
- Forum: Volume 110 (11000-11099)
- Topic: 11065 - A Gentlemen's Agreement
- Replies: 19
- Views: 8725
- Fri Aug 18, 2006 3:37 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11052 - Economic phone calls
- Replies: 26
- Views: 11432