Search found 55 matches

by alu_mathics
Wed Jan 12, 2005 1:52 am
Forum: Volume 2 (200-299)
Topic: 294 - Divisors
Replies: 91
Views: 23667

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.
by alu_mathics
Sun Jan 02, 2005 1:23 pm
Forum: Volume 1 (100-199)
Topic: 164 - String Computer
Replies: 120
Views: 11346

Good to see that you got AC.Hope you will get AC for problem 526.Best of luck :wink:
by alu_mathics
Tue Dec 28, 2004 7:27 pm
Forum: Volume 1 (100-199)
Topic: 164 - String Computer
Replies: 120
Views: 11346

try with this. in: himynameishihaho himynameishohiha associationforcomputingmachinary associationforcomputingmathematics urreallyaniceguy yesiam wowthisisagoodprogram goodprogramthisisindeed # out: Co12Ci14Ca16E Ct26Ce28Cm29It31Ii32Cc33Cs34E Du1Dr1Dr1De1Da1Dl1Dl1Ce2Cs3Dc5De5Dg5Ca5Cm6E Cg1Co3Cd4Cp5Cr...
by alu_mathics
Sun Dec 26, 2004 9:33 am
Forum: Volume 1 (100-199)
Topic: 164 - String Computer
Replies: 120
Views: 11346

try to maintain

insert first , then replace and finally delete.

that is the order should be ICD
by alu_mathics
Sun Dec 26, 2004 9:07 am
Forum: Volume 100 (10000-10099)
Topic: 10000 - Longest Paths
Replies: 160
Views: 36353

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++) { if(p[j].dis>max) { max=...
by alu_mathics
Sat Dec 18, 2004 5:17 pm
Forum: Volume 107 (10700-10799)
Topic: 10795 - A Different Task
Replies: 9
Views: 5692

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...
by alu_mathics
Sat Dec 18, 2004 10:50 am
Forum: Volume 107 (10700-10799)
Topic: 10795 - A Different Task
Replies: 9
Views: 5692

output:

-1
by alu_mathics
Sat Dec 18, 2004 5:33 am
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 28670

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" all the time...
by alu_mathics
Fri Dec 17, 2004 6:25 am
Forum: Volume 107 (10700-10799)
Topic: 10793 - The Orc Attack
Replies: 35
Views: 19624

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...
by alu_mathics
Mon Dec 13, 2004 7:49 pm
Forum: Volume 102 (10200-10299)
Topic: 10249 - The Grand Dinner
Replies: 19
Views: 12140

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...
by alu_mathics
Mon Sep 27, 2004 8:44 pm
Forum: Volume 7 (700-799)
Topic: 796 - Critical Links
Replies: 54
Views: 22556

Wow you got the 1st place.Good job done.Congrates.... :D
by alu_mathics
Mon Sep 27, 2004 5:48 am
Forum: Volume 7 (700-799)
Topic: 796 - Critical Links
Replies: 54
Views: 22556

I agree with you.Its annoying but sometimes we need to make a solution for some wrong cases.
by alu_mathics
Sun Sep 26, 2004 6:21 pm
Forum: Volume 104 (10400-10499)
Topic: 10419 - Sum-up the Primes
Replies: 51
Views: 16850

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 ...
by alu_mathics
Sun Sep 26, 2004 5:40 pm
Forum: Volume 104 (10400-10499)
Topic: 10419 - Sum-up the Primes
Replies: 51
Views: 16850

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 :roll: but true.I should try with my Vcc compiler.
Silverfox03 your output is correct.
by alu_mathics
Sat Sep 25, 2004 4:53 pm
Forum: Volume 104 (10400-10499)
Topic: 10419 - Sum-up the Primes
Replies: 51
Views: 16850

I forgot the critical cases.I generated some inputs.Try with this. Input 346 10 972 10 645 7 578 10 926 1 996 8 568 4 474 10 407 6 441 12 92 1 183 5 183 14 222 6 765 1 660 1 978 13 731 5 976 5 546 12 471 8 438 9 887 3 744 9 622 1 407 10 770 7 93 6 335 7 755 4 584 13 657 6 377 3 552 9 174 13 53 4 283...

Go to advanced search