## Search found 55 matches

Wed Jan 12, 2005 1:52 am
Forum: Volume 2 (200-299)
Topic: 294 - Divisors
Replies: 91
Views: 25762
well you only need to generate primes up to sqrt(1000000000).
why ? try to think abt it.you will find it by yourself.
best of luck.
Sun Jan 02, 2005 1:23 pm
Forum: Volume 1 (100-199)
Topic: 164 - String Computer
Replies: 120
Views: 13462
Good to see that you got AC.Hope you will get AC for problem 526.Best of luck
Tue Dec 28, 2004 7:27 pm
Forum: Volume 1 (100-199)
Topic: 164 - String Computer
Replies: 120
Views: 13462
try with this. in: himynameishihaho himynameishohiha associationforcomputingmachinary associationforcomputingmathematics urreallyaniceguy yesiam wowthisisagoodprogram goodprogramthisisindeed # out: Co12Ci14Ca16E Ct26Ce28Cm29It31Ii32Cc33Cs34E Du1Dr1Dr1De1Da1Dl1Dl1Ce2Cs3Dc5De5Dg5Ca5Cm6E Cg1Co3Cd4Cp5Cr...
Sun Dec 26, 2004 9:33 am
Forum: Volume 1 (100-199)
Topic: 164 - String Computer
Replies: 120
Views: 13462
try to maintain

insert first , then replace and finally delete.

that is the order should be ICD
Sun Dec 26, 2004 9:07 am
Forum: Volume 100 (10000-10099)
Topic: 10000 - Longest Paths
Replies: 160
Views: 39395
very complex implementation of BFS indeed. you have used adjacency list. while(v && e) { j=0; while(p[v].paths[j]>=0)j++; p[v].paths[j]=e; scanf("%d %d",&v,&e); } for the colored part you can use another counter array.it will reduce the time. set max=-1; for( j=0 ;j<=N;j++)...
Sat Dec 18, 2004 5:17 pm
Forum: Volume 107 (10700-10799)
Topic: 10795 - A Different Task
Replies: 9
Views: 6031
3 3 2 1 3 1 2 for ur input the graph matrix would be 1 2 3 4 5 6 1 0 - - - - - 2 - 0 - - - - 3 2 1 0 - - - 4 - - - 0 - - 5 - - - - 0 - 6 - - - - - 0 here '-' stands for infinity. the matrix need to be 6*6 atleast.as u want to find a rally point from which the fr five positions are in unidistance. as...
Sat Dec 18, 2004 10:50 am
Forum: Volume 107 (10700-10799)
Topic: 10795 - A Different Task
Replies: 9
Views: 6031
output:

-1
Sat Dec 18, 2004 5:33 am
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 32950
i hope you have change ur datatype to unsigned long or long long or __int64. consider the case 2147483647 2147483647 then you can get overflow. coz 2147483647*3+1 is out of range of int(long) indeed. input can be 12 10 so swap them and thus you can avoid tle. remember the word "between" al...
Fri Dec 17, 2004 6:25 am
Forum: Volume 107 (10700-10799)
Topic: 10793 - The Orc Attack
Replies: 35
Views: 20362
consider the fact that the farthest point from the desired point can be the shortest distance from the first 5 five points. example. 1 6 10 2 6 10 3 6 10 4 6 10 5 6 10 since the distance from the fr five(1,2,3,4,5) points to 6 are same that is 10, so 6 is a candidate.Again the farthest point(among t...
Mon Dec 13, 2004 7:49 pm
Forum: Volume 102 (10200-10299)
Topic: 10249 - The Grand Dinner
Replies: 19
Views: 12848
here is the greedy one. 1.sort the team based on number of members in decreasing order 2.then assign team members of a team to each table considering the capacity limit of each table. and do same for the next team.... 3.if a member of one team can't be assigned to any table due to table capacity try...
Mon Sep 27, 2004 8:44 pm
Forum: Volume 7 (700-799)
Replies: 54
Views: 23945
Wow you got the 1st place.Good job done.Congrates....
Mon Sep 27, 2004 5:48 am
Forum: Volume 7 (700-799)
Replies: 54
Views: 23945
I agree with you.Its annoying but sometimes we need to make a solution for some wrong cases.
Sun Sep 26, 2004 6:21 pm
Forum: Volume 104 (10400-10499)
Topic: 10419 - Sum-up the Primes
Replies: 51
Views: 18604
I have check the above input using Vcc and they were the same as little joy. Thanks little joy for pointing out the fact. Hope the following are correct. 52 6 349 2 818 12 63 13 983 8 356 9 419 12 167 6 291 10 165 1 181 3 808 6 142 10 878 12 750 13 373 13 175 8 981 2 70 10 8 4 392 11 835 3 198 3 74 ...
Sun Sep 26, 2004 5:40 pm
Forum: Volume 104 (10400-10499)
Topic: 10419 - Sum-up the Primes
Replies: 51
Views: 18604
sorry i haven't judge the outputs carefully.But this has been genrated from my A.C. solution.Long time ago Adrian also pointed out the fact.May
be it is becoz of the borland compiler i used.Strange but true.I should try with my Vcc compiler.