Search found 50 matches: 11526
Searched query: 11526
- Mon Jul 21, 2014 1:59 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
I sent you private message. Check it
- Sat Jul 19, 2014 11:53 am
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
Why is this code getting WA? #include <stdio.h> #include <math.h> int main() { int n, T, sqrtn, i, l1, l2, k; unsigned long long sum, sum2; scanf("%d", &T); while(T--) { scanf("%d", &n); if(n < 0) n = -n; sum = n; sqrtn = sqrt(n); k = 1, l2 = n; for(i=2; i<=sqrtn; i++) { ...
- Mon Mar 03, 2014 11:36 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
Read this thread for ideas on a faster algorithm.
- Mon Mar 03, 2014 8:32 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
How to avoid time-limit exceed in this problem. All I know is the most obvious procedure will give time-limit exceed error. So where can I learn the faster algorithm from, pleeeeze anyone...
- Wed Dec 11, 2013 12:15 am
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
For n=2147483647, the output should be 46475828386. Read this thread for ideas on a faster algorithm.
- Sat Dec 07, 2013 6:56 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
I am getting TLE. If the input is 50, 1 will have to be added to the sum for 25 times(for i=26 to i=50). Then 2 will have to be added for 18 times(for i=16 to i=25). 3 will have to be added for 4 times(for i = 12 to i=16) I am doing this till sqrt of n. Then i am doing the rest of the process in tha...
- Sat May 25, 2013 6:50 am
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
I rebuilded my code again and again. but at last it was this simple silly mistakebrianfry713 wrote:Try the input in the post before yours. You code is throwing a RE on n=0.
Thanks a lot brianfry. :p
- Tue May 21, 2013 3:56 am
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
Try the input in the post before yours. You code is throwing a RE on n=0.
- Sun May 19, 2013 2:04 am
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
I tried this problem at least 30 times. But every time I get WA for this code :
I checked several input-outputs. but i couldn't find my mistake. Please help
Code: Select all
removed after ac
- Fri Feb 08, 2013 8:48 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
Input:AC output:
Code: Select all
2
0
1
Code: Select all
0
1
- Thu Feb 07, 2013 1:20 am
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
#include<stdio.h> #include<math.h> int main() { long long int t,k,n,i,j,l,m,a,b,c; while(scanf("%lld",&t)!=EOF) { for(k=1;k<=t;k++) { scanf("%lld",&n); if(n<=0)printf("\n"); else { j=sqrt(n); l=n; b=n; for(i=2;i<=j;i++) { a=(n/i); c=b-a; l=l+(c*(i-1)); l=l+(n/i...
- Fri Aug 03, 2012 7:52 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
my program is giving right output for all 9 digit numbers. but when i input 2147463638.my program gives 46475329054 as output where the actual output should be 46475375394.can't figure out what the problem is... #include<iostream> #include<math.h> using namespace std; int main () { int test, j; long...
- Sat Jan 14, 2012 12:20 am
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
You get TLE because you have a loop of n/2 including a divide. For n=2147483647, how long does your code take to run? Read this thread for ideas on a faster algorithm.
- Thu Jan 12, 2012 10:45 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
[/code]#include<stdio.h> #include<math.h> int main() { long int dem,n,i,kase,j; scanf("%ld",&kase); for(j=0;j<kase;j++) { scanf("%ld",&n); dem=n/2; long long int res=0; for(i=1;i<=dem;i++) res+=n/i; res=res+(n-dem); printf("%lld\n",res); } return 0; } i got time...
- Wed Sep 30, 2009 11:53 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 23482
Re: 11526 - H(n)
i am new
thanks for ur ...........
thanks for ur ...........