## Search found 8 matches

Sun Aug 11, 2002 6:49 pm
Forum: Volume 1 (100-199)
Topic: 193 - Graph Coloring
Replies: 93
Views: 20204

### 193 --

/*@BEGIN_OF_SOURCE_CODE*/ #include<stdio.h> #include<stdlib.h> #define BLACK 2 #define WHITE 1 int vertex[102][102]; int flag[102],x[102],max,vertx; void Coloring(int i,int count) { int j; if(i==vertx){ if(max<count){ max =count; for(j=0;j<vertx;j++) if(flag[j]==BLACK) x[j] =1; else x[j] = 0; } retu...
Sun Aug 11, 2002 6:45 pm
Forum: Volume 103 (10300-10399)
Topic: 10326 - The Polynomial Equation
Replies: 18
Views: 5941

/*@BEGIN_OF_SOURCE_CODE*/ #include<stdio.h> int main() { int n,i,j,k,temp,flag; long long Coeff[55],sum,root[55]; while(scanf("%d",&n)==1){ for(i = 0;i<n;i++) scanf("%lld",&root ),Coeff = 0; Coeff[0] = 1; for(i =n-1;i>0;i--){ Coeff[0] *=root ; for(j=0;j<n;j++){ sum = 1; for(k =n-i-1;k>=0;k--){ sum*=...
Fri Aug 09, 2002 10:09 pm
Forum: Volume 101 (10100-10199)
Topic: 10100 - Longest Match
Replies: 95
Views: 19957
hey sjn
Can you see any error in my code? Is there any difference with your code
Pls let me know
Fri Aug 09, 2002 5:49 am
Forum: Volume 4 (400-499)
Topic: 497 - Strategic Defense Initiative
Replies: 144
Views: 20167
you find ABout multiple input in problemset page.see this ,this is a different input format.
Fri Aug 09, 2002 5:41 am
Forum: Volume 101 (10100-10199)
Topic: 10100 - Longest Match
Replies: 95
Views: 19957

### re: SJN

1. Length of longest match : 1
2. Length of longest match : 1
Wed Aug 07, 2002 9:15 pm
Forum: Volume 101 (10100-10199)
Topic: 10100 - Longest Match
Replies: 95
Views: 19957
/*@BEGIN_OF_SOURCE_CODE*/ #include<stdio.h> #include<string.h> #include<ctype.h> int C[3][65]; int LCS(char Model[][23],char Sample[][23],int n,int m) { int i,j; for(i=0;i<2;i++) C [0] = 0; for(j=0;j<=m;j++) C[0][j] = 0; for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ if(strcmp(Model ,Sample[j])==0) C[i%2][j]...
Wed Aug 07, 2002 9:12 pm
Forum: Volume 101 (10100-10199)
Topic: 10190 - Divide, But Not Quite Conquer!
Replies: 105
Views: 22968
/*@BEGIN_OF_SOURCE_CODE*/ #include<stdio.h> #include<math.h> int main() { long long n,div,x,y; while(scanf("%lld%lld",&n,&div)==2){ if(div < 2 || n< 2) printf("Boring!\n"); else { x = (log10(n)/log10(div)); y = pow(div,x); if(y != n) printf("Boring!"); else for( ;n>=1 ;n/=div) printf("%lld ",n); pri...
Wed Aug 07, 2002 9:04 pm
Forum: Volume 5 (500-599)
Topic: 514 - Rails
Replies: 79
Views: 23665

### What is the algorithm

It seems strange . What is the algorithm of that probelm ? I tried in a similar way but got wa. Will someone explain the algorithm?