Search found 13 matches

by sabir
Tue Oct 07, 2008 10:25 pm
Forum: Volume 115 (11500-11599)
Topic: 11503 - Virtual Friends
Replies: 49
Views: 17562

Re: 11503-Virtual Friends

i also use c++. here is my code #include <stdio.h> #include <stdlib.h> #include <string.h> #define sz 1000010 long vertex[sz],rank[sz],len[sz]; long edge,top; typedef struct { char name[25]; }name_info; name_info data[sz]; long Find_set(long num) { if(num!=vertex[num]) { vertex[num]=Find_set(vertex[...
by sabir
Tue Oct 07, 2008 8:23 pm
Forum: Volume 115 (11500-11599)
Topic: 11503 - Virtual Friends
Replies: 49
Views: 17562

11503 - Virtual Friends

i use union find algo and get tle.give any idea how to optimize time.
by sabir
Thu Aug 14, 2008 9:06 pm
Forum: Volume 114 (11400-11499)
Topic: 11450 - Wedding shopping
Replies: 14
Views: 6366

Re: 11450 - Wedding shopping

i found error in my code.But now i am getting TLE.Plz help me.Here is my code #include <stdio.h> #include <stdlib.h> #define sz 30 long cost[sz][sz]; bool dup[sz][210],finish; long type[sz],m,c,count,max; void check(long node) { long i,temp; node++; if(node==c)//last row { for(i=type[node]-1;i>=0;i-...
by sabir
Mon Aug 11, 2008 8:54 pm
Forum: Volume 113 (11300-11399)
Topic: 11352 - Crazy King
Replies: 32
Views: 12036

Re: 11352 - Crazy King

i use BFS but WA.I/O needed.
by sabir
Mon Aug 11, 2008 8:41 pm
Forum: Volume 114 (11400-11499)
Topic: 11450 - Wedding shopping
Replies: 14
Views: 6366

Re: 11450 - Wedding shopping

Thnx andmej for ur I/O.My program give same output as your.But WA.Do u or any one else have more I/O ?
by sabir
Sat Aug 09, 2008 8:52 pm
Forum: Volume 114 (11400-11499)
Topic: 11450 - Wedding shopping
Replies: 14
Views: 6366

Re: 11450 - Wedding shopping

i am using dp but get wa.Give me some i/o.
by sabir
Mon Oct 29, 2007 7:19 am
Forum: Volume 6 (600-699)
Topic: 677 - All Walks of length "n" from the first node
Replies: 17
Views: 8083

Code modefied.But still WA. #include <stdio.h> #include <math.h> #define sz 20 long par[sz]; long n,vertex,count; long mat[sz][sz]; long visit[sz],ans[sz]; bool flag; void DfsVisit(long node) { long i; visit[node]=1; if(n+1==count) { printf("(1,"); flag=false; for(i=1;i<=n;i++) { printf("%ld", ans[i...
by sabir
Tue Oct 23, 2007 9:28 am
Forum: Volume 6 (600-699)
Topic: 677 - All Walks of length "n" from the first node
Replies: 17
Views: 8083

i am getting WA in this code.plz help.

Code: Select all

Deleted
by sabir
Fri Jun 29, 2007 7:02 pm
Forum: Volume 110 (11000-11099)
Topic: 11088 - End up with More Teams
Replies: 30
Views: 17520

thnks, i will try.
by sabir
Tue Jun 26, 2007 7:52 pm
Forum: Volume 110 (11000-11099)
Topic: 11088 - End up with More Teams
Replies: 30
Views: 17520

thanks nymo for ur reply.but i do not understand full.can u explain more
detail. what u mean by max(Best[S - SiSjSk])

sorry for poor english.
[YOU CAN NOT CHANGE YOUR FATE]
by sabir
Tue Jun 26, 2007 7:34 pm
Forum: Algorithms
Topic: convex hull sorting
Replies: 1
Views: 3806

convex hull sorting

i m having problem with my convex hull algo with sorting[ /color].i get acc with this code 11096,218,10078 but get wrong ans many other. my code is here. plz any one can help me to find bugs int compare_point(const void *a, const void *b) { long xprod; point *point_a, *point_b; point_a=(point *)a; p...
by sabir
Sat Jun 23, 2007 7:39 pm
Forum: Volume 110 (11000-11099)
Topic: 11088 - End up with More Teams
Replies: 30
Views: 17520

11088(Backtracking)

can any one give me any hint how to solve this prob using backtracking,
i tried but ...i read prev all post but do not get any idea about bracktracking solution.
by sabir
Thu Jun 14, 2007 8:58 am
Forum: Volume 1 (100-199)
Topic: 153 - Permalex
Replies: 32
Views: 12953

i solve this problem by counting.my algo is follow. get input;copy to another,sort 2nd one,then compare if 1st elements in 2nd str is smaller then 1st elements in 1st str then get rest of data from 2nd str,again sort and compare as before and did it recursevely. i have passed all sample input in boa...

Go to advanced search