| Title |
User |
Message |
Place |
Date Posted |
| Re: Sieve |
bbi5291 |
Your method of checking for pairs is simply too inefficient. If you know one of the numbers of the pair, you already know what the other should be - why would you need to use a loop to search for it? |
wc99p4 |
Dec 18, 2008 - 1:44:58 am UTC |
| Re: ?? |
bbi5291 |
You are forgetting that if string "s" has length "l", then the first character in s is actually s[0] and the last is s[l-1]: not s[1] and s[l]. Also, every time you perform an erase operation, the cha... |
ccc07j4 |
Dec 18, 2008 - 1:38:59 am UTC |
| Sieve |
seyonv |
I'm getting time limit exceeded even with the sieve. I just created the array and found all prime numbers and then I stored all primes in another array and outputed them by just using an embedded for ... |
wc99p4 |
Dec 18, 2008 - 1:06:59 am UTC |
| Re: Re: Re: ??? |
SourSpinach |
Hence, you don't get 10 points. |
expr |
Dec 18, 2008 - 12:26:00 am UTC |
| ?? |
purohit3105 |
Whats wrong with the code that I submmitted? It shouldn't give me a wrong error and it works fine on my computer. I also haven't used any reserved words as var names...(I think..) |
ccc07j4 |
Dec 17, 2008 - 11:33:21 pm UTC |
| Hint |
bbi5291 |
If you do a move 12 times it's the same as not doing it at all. (so mod 12). Furthermore, mod 12, there's only one possible solution per test. If you can determine a sequence of moves that will turn j... |
clocks |
Dec 17, 2008 - 3:06:25 am UTC |
| Hint |
bbi5291 |
You can divide the squares into two types: those for which x+y is even, and those for which x+y is odd. Also, this is a DP problem - see if you can figure out how to compute, for a given (x,y) the sum... |
cheasy |
Dec 17, 2008 - 3:03:27 am UTC |
| Re: Re: Re: Re: Bosco |
bbi5291 |
scanf and printf |
primes2 |
Dec 17, 2008 - 2:23:34 am UTC |
| Re: Re: Re: Bosco |
purohit3105 |
What can you replace cin or cout with? |
primes2 |
Dec 17, 2008 - 1:43:30 am UTC |
| Re: Re: ??? |
frenzybenzy |
unfortunatly, i have no knowledge in c++ or c. |
expr |
Dec 17, 2008 - 12:42:05 am UTC |