Search found 405 matches

by anupam
Sat Dec 14, 2002 6:59 am
Forum: Volume 102 (10200-10299)
Topic: 10252 - Common Permutation
Replies: 150
Views: 53041

thank u, and sorry to disturb u. i actually can't understand the problem. it seems to me as a lcs prob. i rarely put src. code in board. but sometimes when i can't get rid of a lot of wa, i become frustated and then put it. please tell me abuot the problem and algrthm in a simpler way, please? :oops...
by anupam
Thu Dec 12, 2002 3:20 pm
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 32584

can any1 tell me what the problem is in my program. thanks in adv. :oops: :oops: [cpp] #include<stdio.h> #include<stdlib.h> #define N 10000 main() { int n,z,i,l,k,m,b[N]; char ch,c[50],d[N][20]; scanf("%d",&n); scanf("%c",&ch); for(z=0;z<n;z++) { k=0; while(1) { m=0; while(1) { scanf("%c",&ch); if(...
by anupam
Thu Dec 12, 2002 3:12 pm
Forum: Volume 102 (10200-10299)
Topic: 10252 - Common Permutation
Replies: 150
Views: 53041

10252 - Common Permutation

i don't know what the wrong case is. i use LCS. please check. thanks. :oops: :oops: :oops: :oops: #include<stdio.h> #include<string.h> #define N 1500 int p=0,c[N][N],f=0; char b[N][N],x[N],y[N],a[N]; void print(int i,int j) { if(i==0 || j==0) return; if(b [j]=='\\') { print(i-1,j-1); /* printf("%c",...
by anupam
Thu Dec 12, 2002 3:04 pm
Forum: Volume 6 (600-699)
Topic: 674 - Coin Change
Replies: 77
Views: 26585

sorry, that is not the problem. the code is here? sorry.... [cpp] #include<stdio.h> #define N 2100 long int n,a[5][N]; double m; void rec(void) { long int i,j,k,l,p,q; for(i=0;i*50<N;i++) { if(a[0][i]>n) break; for(j=0;j*25<N;j++) { if((a[0][i]+a[1][j])>n) break; for(k=0;k*10<N;k++) { if((a[0][i]+a[...
by anupam
Thu Dec 12, 2002 2:58 pm
Forum: Volume 6 (600-699)
Topic: 674 - Coin Change
Replies: 77
Views: 26585

674 - Coin Change

:oops: i don't know how to solve it by a short time. i use the formula (1+x+x^2+...)(1+x^5+x^10+...)(..).. but it takes long time and i have got tle. is there any way to solve it in a short time? please help.. [cpp] #include <iostream.h> #define ONLINE_JUDGE struct pinball { bool bouncer; int value...
by anupam
Thu Dec 05, 2002 4:15 pm
Forum: Volume 102 (10200-10299)
Topic: 10200 - Prime Time
Replies: 202
Views: 63030

thank u liu and larry for your advices. i am now careful abuot such simple mistakes in algthms.
thanks again. :wink: :D :) [/b]
by anupam
Sat Nov 30, 2002 8:12 am
Forum: Volume 104 (10400-10499)
Topic: 10400 - Game Show Math
Replies: 32
Views: 17971

hello,
i don't think yahoo's program catch all the solutions.
it only catch a sol then it exits from recurssion.
what will be the problem. i can't guess.
--thanks.
by anupam
Wed Nov 27, 2002 12:02 pm
Forum: Volume 102 (10200-10299)
Topic: 10200 - Prime Time
Replies: 202
Views: 63030

please check the source code it gets tle again #include<stdio.h> #include<string.h> #include<math.h> #define N 10100 main() { long k=0,i,j,l,z,a[N],r,m,n,val; for(i=2;i<=10100;i++) { for(j=2;j<=(i/2);j++) if(!(i%j)) break; if(j>(i/2)) a[k++]=i; } while(1) { r=scanf("%ld%ld",&m,&n); if(r==EOF) break;...
by anupam
Wed Nov 27, 2002 11:52 am
Forum: Volume 102 (10200-10299)
Topic: 10200 - Prime Time
Replies: 202
Views: 63030

i can't find a better way to solve it, it got tletle... will anyone help please #include<stdio.h> #include<string.h> #include<math.h> #define N 10100 main() { long k=0,i,j,l,z,a[N],r,m,n,val; for(i=2;i<=10100;i++) { for(j=2;j<=(i/2);j++) if(!(i%j)) break; if(j>(i/2)) a[k++]=i; } while(1) { r=scanf("...
by anupam
Wed Nov 27, 2002 11:50 am
Forum: Volume 104 (10400-10499)
Topic: 10400 - Game Show Math
Replies: 32
Views: 17971

hello kuegel,
will u tell me the way of bfs elaborately, not by only touching the word,
i tried all the codes of me and it is similar that of yahoo. so getting tle.
please help.

--anupam is waiting for your reply :oops: :oops:
by anupam
Wed Nov 20, 2002 8:22 pm
Forum: Volume 4 (400-499)
Topic: 459 - Graph Connectivity
Replies: 132
Views: 25864

#include<stdio.h> #include<string.h> #include<stdlib.h> #define N 50 int color[N],a[N][N],n; char ch[N]; void dfs(int b) { int i; color[b]=1; for(i=0;i<n;i++) if(a[b][i] && a[i][b] && (!color[i])) dfs(i); } main() { int m,i,j,z,l; gets(ch); m=atoi(ch); gets(ch); for(z=0;z<m;z++) { gets(ch); n=ch[0]...
by anupam
Tue Oct 29, 2002 1:21 pm
Forum: Volume 4 (400-499)
Topic: 474 - Heads / Tails Probability
Replies: 50
Views: 11297

Hello, i have tried with many types adviced by u,but i got wa for abot 10 times. will those person look about the matter why it is getting wa. :oops: [b] #include<stdio.h> #include<stdlib.h> #include<math.h> int main() { long N, expo,n,k; double l; int m; int start = 0; while(1) { if (fscanf (stdin,...
by anupam
Mon Oct 28, 2002 1:07 pm
Forum: Volume 5 (500-599)
Topic: 501 - Black Box
Replies: 35
Views: 16337

hello all, I have posted my code here, because i have tried in many ways to get ac but :oops: :oops: i have got w ans. please check it. code:[c] [b] #include<stdio.h> #define NUM 30100 main() { long long int m,i,j, k,n,l,s,p, c[NUM],d[NUM],a[NUM]; scanf("%lld%lld",&m,&n); s=0; for(i=0;i<m;i++) scanf...
by anupam
Tue Oct 22, 2002 6:12 pm
Forum: Volume 5 (500-599)
Topic: 524 - Prime Ring Problem
Replies: 74
Views: 19815

:oops: :oops: i have also got out. lim. ex..
but i am sure i controlled my counter and i have got right ans. for the highest input.
but sev times i have got the message.
please give some trics.
--thanks
-- :evil: :evil:
[/img]
by anupam
Sat Oct 05, 2002 7:13 pm
Forum: Volume 5 (500-599)
Topic: 568 - Just the Facts
Replies: 39
Views: 16747

not realize

:oops: :evil: please send eor whole program so that i can realize what u meant by the variables. :oops: :evil:

Go to advanced search