Search found 12 matches

by Niaz Morshed
Sun Nov 23, 2003 12:52 am
Forum: Volume 4 (400-499)
Topic: 465 - Overflow
Replies: 104
Views: 26797

There is an input for which most of the people get WA ! I have corrected many person's code by giving this input. I am giving it here, if any body need more help, then write here, in future i will help again. 2147483648 + -1 Yes, it is possible :o . Just try it with your code. First number is too bi...
by Niaz Morshed
Sat Nov 22, 2003 6:17 am
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 41561

583

Here is my code. Please help me ! I am totally confused about this TLE ! :oops: [cpp]#include<stdio.h> #include<math.h> #define max 2000000 char prime[max+10]; long PRIME[90000]; /*int isprime(long n) { long i; for(i=2;i<=sqrt(n);i++) { if(n%i==0) return 0; } return 1; }*/ void find_prime() { long i...
by Niaz Morshed
Wed Nov 19, 2003 12:23 pm
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 41561

Hi raymond85 ! I tried to solve this problem and faced the same problem that u faced. I use sieve method to find the primes from 2 to 20000000. then for bigger prime i use 'sqrt' method. My code can run quite nice in my PC for large input. such as (2^31)-1 :-) but i got TLE. Why ? can u help me to s...
by Niaz Morshed
Wed Nov 19, 2003 12:15 pm
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 41561

I got it :-) . Your code can not ganerate big PRIMES. Use sieve methods to generate PRIMES. If u do not know the method, tell me... i will send u my function which can generate big primes.
Niaz 8)
by Niaz Morshed
Wed Nov 19, 2003 12:11 pm
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 41561

I dont know the reason for TLE but for this in put <2147483647> your program does not give any out put. WHY ? At first try to fix this problem. Hopefully you can find the TLE reason soon. I will try to reply again. I will look at ur code carefully later.
Niaz :lol:
by Niaz Morshed
Wed Nov 19, 2003 12:01 pm
Forum: Volume 100 (10000-10099)
Topic: 10049 - Self-describing Sequence
Replies: 33
Views: 14146

Thanks friend.

Thanks friend for giving me the formula. I haven't yet tried. If i get accepted, i will informe you.

Niaz :lol:
by Niaz Morshed
Mon Nov 17, 2003 10:02 am
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 66798

Shamim ! doing good job, carry on . . . :D :D :D
by Niaz Morshed
Mon Nov 17, 2003 9:52 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 212209

Try to take the thing positively… then u will get positive answer (accepted). Negative thinking can only bring u a negative reply ( i,e WA) :D :D :D
by Niaz Morshed
Mon Nov 17, 2003 9:47 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 55751

When we run our program in TC we usually don't get runtime error. If we compile our code in gcc then we can easily find the problem. Please compile ur code in gcc and then look what it says. Another thing for run time error is to access wrong area such as str = '0' [ but i = -1] or if we what to acc...
by Niaz Morshed
Mon Nov 17, 2003 9:39 am
Forum: Volume 100 (10000-10099)
Topic: 10041 - Vito's Family
Replies: 90
Views: 32418

Algo

One of the important property of the median is the distance from any median (in case of even we get two medians) to each element is equal. So u need not to find the distance from each median or from the mean of the median. I have seen that many persons tried to find the mean in the median :D So don'...
by Niaz Morshed
Sun Nov 16, 2003 7:18 am
Forum: Volume 100 (10000-10099)
Topic: 10049 - Self-describing Sequence
Replies: 33
Views: 14146

10049

I am really confused with this problem. I have read the previous posts at the board but i could not find the besic thing i,e the formula :-) . Is there any one can tell me about the formula and the way to solve it (if can). Thanks in advance. :(
by Niaz Morshed
Sun Nov 09, 2003 7:48 pm
Forum: Volume 8 (800-899)
Topic: 861 - Little Bishops
Replies: 33
Views: 21836

861

Any one can help me saying a formula for this problem ? Thanks in advance :D

Go to advanced search