Search found 853 matches

by sohel
Sat May 31, 2003 8:40 am
Forum: Volume 4 (400-499)
Topic: 495 - Fibonacci Freeze
Replies: 222
Views: 53893

First I tried to solve it using your technique and got TLE.

Try to store all the answers before considering inputs.
And then simply print("The xxxxxxxxxx is %s",fib[n]);

Hope it helps.
by sohel
Wed May 28, 2003 11:43 am
Forum: Algorithms
Topic: close packing problems
Replies: 1
Views: 1877

close packing problems

Hi.
Can anyone tell me a good site for solving close packing problems.
That is circles in triangles && circles in hexagons and pentagons
and so on.

Thanks.
by sohel
Sun Apr 27, 2003 12:18 pm
Forum: Volume 104 (10400-10499)
Topic: 10465 - Homer Simpson
Replies: 75
Views: 32445

Remember beer time has got to be minimum;

sample input
123 124 125

Output is
1 1

and not
1 2
by sohel
Sun Mar 30, 2003 11:57 am
Forum: Algorithms
Topic: Algorithm for intersecting lines
Replies: 3
Views: 3005

Algorithm for intersecting lines

How to determine whether two lines intersect, given the end points of the two lines?
by sohel
Sat Mar 29, 2003 12:12 pm
Forum: Volume 6 (600-699)
Topic: 642 - Word Amalgamation
Replies: 9
Views: 7450

infinite loop

First consider this loop: main() { while(1)//-----------------------Never ends , condition always true { time=0; while(gets(dic[time])&&strcmp(dic[time],"XXXXXX")) { time++; } while(gets(nus)&&strcmp(nus,"XXXXXX")) { . . . . . your program never ends. and another ...
by sohel
Tue Mar 18, 2003 12:57 pm
Forum: Volume 103 (10300-10399)
Topic: 10340 - All in All
Replies: 129
Views: 46141

Still confused!@#

oops. :o
by sohel
Mon Mar 17, 2003 12:53 pm
Forum: Volume 103 (10300-10399)
Topic: 10340 - All in All
Replies: 129
Views: 46141

10340 AllinAll help!!!

I don't understand why this program is not accepted. I get wrong answer. here is my code: [cpp] #include<stdio.h> #include<string.h> int main() { int i,j=0,cnt=0,lf,ls; char frst[1000001]; char scnd[1000001]; char ch; while(scanf("%s",frst)!=EOF) { lf=strlen(frst); scanf("%s",scn...
by sohel
Mon Mar 17, 2003 12:41 pm
Forum: Volume 100 (10000-10099)
Topic: 10013 - Super long sums
Replies: 212
Views: 62652

Thanx

I have changed my code according to your suggestions and got AC.

Thanks. :)
by sohel
Mon Mar 17, 2003 7:53 am
Forum: Volume 100 (10000-10099)
Topic: 10013 - Super long sums
Replies: 212
Views: 62652

10013 RTE.

Can any one tell me why this program gets a runtime error. I have not considered any negetive index and the array size is also large enough. here is my code: [cpp] #include<stdio.h> #define max 1000001 int main() { int a[max],b[max]; int n,carry=0,final=0,sum; char ans[max]=""; char t; uns...
by sohel
Mon Feb 24, 2003 10:01 am
Forum: Volume 103 (10300-10399)
Topic: 10375 - Choose and divide
Replies: 23
Views: 15207

10375 help!

[cpp] Can someone tell me why I get a wrong answer? Thank you! here is my source code #include<stdio.h> #include<math.h> int main() { long double p,q,r,s,lc=0.0,c,i,k; while(scanf("%Lf %Lf %Lf %Lf",&p,&q,&r,&s)!=EOF) { for(i=q+1;i<=p;i++) lc=lc+log(i); for(i=s+1;i<=r;i++) l...
by sohel
Sat Feb 08, 2003 2:39 pm
Forum: Volume 4 (400-499)
Topic: 446 - Kibbles "n" Bits "n" Bits "n" Bits
Replies: 50
Views: 10440

446 WA

WA code [code] #include<stdio.h> #include<string.h> #include<math.h> int main() { char a[4]; char c[4]; char sa[15]; char sc[15]; char s; int da=0,dc=0,n,i,la,lc,cnt,k,p; scanf("%d",&n); for(cnt=0;cnt<n;cnt++) { scanf("%s %c %s",a,&s,c); la=strlen(a); lc=strlen(c); for(i=...
by sohel
Tue Feb 04, 2003 11:51 am
Forum: Volume 102 (10200-10299)
Topic: 10235 - Simply Emirp
Replies: 150
Views: 47222

10235 Emirp Why WA

if anyone can tell me why this program is wrong .... I would be very grateful. #include<stdio.h> #include<math.h> int chkprime(unsigned long); int main() { int k=0,cnt=0,j,in; unsigned long n,rf=0,xf,fnum[50],num; while(scanf("%lu",&n)!=EOF) { num=n; if(!(n%2) || !(n%3)) {k=0;if(n==2 |...
by sohel
Sun Feb 02, 2003 11:53 am
Forum: Volume 103 (10300-10399)
Topic: 10340 - All in All
Replies: 129
Views: 46141

10340 all in all, why run time error

---

Go to advanced search