Search found 4 matches

by dotnet12
Sat Aug 18, 2012 5:59 pm
Forum: Volume 4 (400-499)
Topic: 495 - Fibonacci Freeze
Replies: 222
Views: 27606

Re: 495 - Fibonacci Freeze

Can any1 please tell me what is wrong wid dis solution? #include <stdio.h> int main() { long long int f[5000],in,last=f[0]; int i; while((scanf( "%lld" , &in))==1) { for(i=0;i<=in;i++) { f[0]=0,f[1]=1; f =f[i-1]+f[i-2]; if(f >last) { last=f ; } } printf("The Fibonacci number for %lld is %lld \n",in,...
by dotnet12
Sat Aug 18, 2012 11:01 am
Forum: Volume 109 (10900-10999)
Topic: 10994 - Simple Addition
Replies: 41
Views: 14743

10994- Need help

The solution is correct but it exceeds time limit so what can I do about it? Please tell me anyone. Here is my solution: #include <stdio.h> int fu(int ab) { if(ab%10>0 && ab>0) { return ab%10; } else { return ab/10; } } int S(int a,int b) { int ans=0,i; for(i=a;i<=b;i++) { ans+=fu(i); } printf("%d",...
by dotnet12
Sat Aug 18, 2012 3:10 am
Forum: Volume 109 (10900-10999)
Topic: 10994 - Simple Addition
Replies: 41
Views: 14743

Re: #10994- Need help

can u give 1? :D :D
by dotnet12
Fri Aug 17, 2012 9:49 pm
Forum: Volume 109 (10900-10999)
Topic: 10994 - Simple Addition
Replies: 41
Views: 14743

#10994- Need help

The solution is correct but it exceeds time limit so what can I do about it? :( :( Please tell me anyone. Here is my solution: #include <stdio.h> int fu(int ab) { if(ab%10>0 && ab>0) { return ab%10; } else { return ab/10; } } int S(int a,int b) { int ans=0,i; for(i=a;i<=b;i++) { ans+=fu(i); } printf...

Go to advanced search