Search found 17 matches

by maruf
Sun Aug 03, 2008 9:54 pm
Forum: Volume 110 (11000-11099)
Topic: 11057 - Exact Sum
Replies: 50
Views: 20885

Re: 11057 - Exact Sum

y rte??? :roll: #include<stdio.h> long dif(long a,long b); int main() { long n,p,x[10099],r=0,s,m,j,min,k; while(scanf("%ld",&n)==1) { for(long i=0;i<n;i++) scanf("%ld",&x[i]); scanf("%ld",&p); r=0; for(k=0;k<n-1;k++) { for(j=k+1;j<n;j++) { if(x[k]+x[j]==p) { min=dif(x[k],x[j]); { if(r==0) s=min; r=...
by maruf
Sun Aug 03, 2008 1:37 pm
Forum: Volume 100 (10000-10099)
Topic: 10062 - Tell me the frequencies!
Replies: 235
Views: 35599

Re: 10062 - Tell Me the Frequencies!

where is the bug???? :roll: #include<stdio.h> #include<string.h> int main() { char x[5000]; char a[5000]; int b[5000]; int i,j,cs; int c=1,p,pass,t,m; while(gets(x)) { if(cs==1) printf("\n"); cs=1; p=strlen(x); int k=0; for(i=0;i<p;i++) { c=1; if(x[i]=='\0') continue; for(j=i+1;j<p;j++) { if(x[i]==x...
by maruf
Sun Aug 03, 2008 11:42 am
Forum: Volume 4 (400-499)
Topic: 406 - Prime Cuts
Replies: 187
Views: 21769

Re: 406 - Prime Cuts

these are some output...where should i print "\n"?? :roll: 100 100: 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 100 50: 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 100 51: 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 ...
by maruf
Sun Aug 03, 2008 8:04 am
Forum: Volume 4 (400-499)
Topic: 406 - Prime Cuts
Replies: 187
Views: 21769

Re: 406 - Prime Cuts

cut.....acc
by maruf
Thu Jul 17, 2008 4:27 pm
Forum: Volume 4 (400-499)
Topic: 498 - Polly the Polynomial
Replies: 73
Views: 13284

Re: 498 TLE

For each pair of lines, your program should evaluate the polynomial for all the values of x
what is meant by "evaluating" here??plz help........
by maruf
Thu Jul 10, 2008 12:14 pm
Forum: Volume 3 (300-399)
Topic: 355 - The Bases Are Loaded
Replies: 74
Views: 22479

Re: 355 - The Bases Are Loaded

still WA...
should i use array for generating output??
by maruf
Wed Jul 09, 2008 9:53 pm
Forum: Volume 3 (300-399)
Topic: 355 - The Bases Are Loaded
Replies: 74
Views: 22479

Re: 355 - The Bases Are Loaded

getting WA.plz help #include<stdio.h> #include<string.h> #include<math.h> int main() { long long int a,i,k,n,m; long long int p,q; long long int y[5000]; char x[5000]; while(scanf("%lld",&p)!=EOF) { scanf("%lld",&q); scanf("%s",x); n=strlen(x); int f=1; for(i=0;i<n;i++) { if(x[i]>='A' && x[i]<='F') ...
by maruf
Sat Jul 05, 2008 9:37 pm
Forum: Volume 108 (10800-10899)
Topic: 10849 - Move the bishop
Replies: 44
Views: 15969

Re: 10849 - Move the bishop

cut
by maruf
Sat Jul 05, 2008 7:20 pm
Forum: Volume 108 (10800-10899)
Topic: 10849 - Move the bishop
Replies: 44
Views: 15969

Re: 10849 - Move the bishop

cut
by maruf
Sat Jul 05, 2008 3:36 pm
Forum: Volume 108 (10800-10899)
Topic: 10849 - Move the bishop
Replies: 44
Views: 15969

Re: 10849 - Move the bishop

check this input && output :roll: 1 //test case 16 // the number of tests for that case. 5 //chess board with NxN squares 1 1 1 1 0 1 1 2 1 no move 1 1 1 2 no move 1 1 2 2 1 1 1 6 1 no move 1 1 1 3 2 1 1 3 1 2 2 1 3 1 no move 2 1 3 2 1 2 1 2 3 2 1 1 5 5 1 1 2 5 4 2 1 1 1 5 2 1 2 1 5 no move 2 2 2 2 ...
by maruf
Fri Jul 04, 2008 8:26 pm
Forum: Volume 108 (10800-10899)
Topic: 10849 - Move the bishop
Replies: 44
Views: 15969

Re: 10849 - Move the bishop

what will happen if the bishop or the target is placed out of the board??
you should consider the black and white cells of the chess board accurately.......
the bishop can be white and black colours too..... :roll:
by maruf
Fri Jul 04, 2008 5:34 pm
Forum: Volume 108 (10800-10899)
Topic: 10849 - Move the bishop
Replies: 44
Views: 15969

Re: 10849 - Move the bishop

check this input:
1 1 2 2
output of my acc code is:
1
hope it will help....there are more conditions than u have assumed....... :roll:
by maruf
Mon Jun 30, 2008 12:07 pm
Forum: Volume 102 (10200-10299)
Topic: 10252 - Common Permutation
Replies: 150
Views: 50590

Re: 10252 - Common Permutation

Given two strings of lowercase letters, a and b, print the longest string x of lowercase letters such that there is a permutation of x that is a subsequence of a and there is a permutation of x that is a subsequence of what is meant hear by "permutation" && "subsequence"?? i am totally in dark :cry...
by maruf
Thu Jun 26, 2008 7:58 pm
Forum: Volume 1 (100-199)
Topic: 191 - Intersection
Replies: 103
Views: 17723

Re: 191, WA

code removed
by maruf
Thu Jun 19, 2008 12:21 pm
Forum: Volume 111 (11100-11199)
Topic: 11192 - Group Reverse
Replies: 22
Views: 11247

Re: 11192 - Group Reverse

thank u shiplu vai
i hv got ac :D

Go to advanced search