Search found 261 matches

by harryh
Sun Apr 10, 2011 2:16 pm
Forum: Clarifications on Project Euler Problems
Topic: Problem 332
Replies: 4
Views: 3040

Re: Problem 332

LarryBlake wrote:Is that correct?
Yep, the point (x,y,z) must be on the surface of the sphere and its coordinates (i.e. x, y and z) must be integers.
by harryh
Sun Mar 20, 2011 7:53 am
Forum: Clarifications on Project Euler Problems
Topic: Problem 329
Replies: 18
Views: 5651

Re: Problem 329

Yes, there is a croak for the first square too (the wording has not been changed).
Thanks for pointing out the spelling error - now fixed.
by harryh
Wed Mar 16, 2011 9:08 am
Forum: Clarifications on Project Euler Problems
Topic: Problem 328
Replies: 27
Views: 8489

Re: Problem 328

@sivakd : But, as I can see, now you've managed to solve it (and make the fastest-20 list too !). Well done :D

A couple of days ago, you asked "if the solutions so far are meeting the 1 minute rule".
How do you feel now that your own solution is "under 2 sec" ? :)
by harryh
Mon Mar 14, 2011 2:45 pm
Forum: Programming languages
Topic: Fortran
Replies: 2
Views: 2470

Re: Fortran

You can PM your Fortran code to me, if you wish. I very rarely use Fortran nowadays, but my experience with it goes back several decades :)
by harryh
Mon Mar 14, 2011 7:17 am
Forum: Clarifications on Project Euler Problems
Topic: Problem 328
Replies: 27
Views: 8489

Re: Problem 328

Well said TripleM. No further intermediate results should be given (at this stage, anyway). Sorry, kingvash!
Let's not forget that the idea behind this forum is to help with understanding the problems (though I plead guilty to occasionally going beyond that).
by harryh
Sun Mar 13, 2011 10:11 am
Forum: Clarifications on Project Euler Problems
Topic: Problem 328
Replies: 27
Views: 8489

Re: Problem 328

The result posted by sivakd for the sum 1 to 200, seems correct. :)
However, the result posted by Cifko for the sum 1 to 10000 looks too high.
by harryh
Sun Mar 13, 2011 2:32 am
Forum: Clarifications on Project Euler Problems
Topic: Problem 328
Replies: 27
Views: 8489

Re: Problem 328

Yes. For n=8, with "4" as the first question, the worst-case has a cost of 16 (questions: "4", "5" and "7"). The "binary search" strategy (first question "4", second question "2" or "6" depending on the first answer etc) has a worst-case cost of 17 as described in 328 . Neither of those is as good a...
by harryh
Thu Feb 24, 2011 5:54 pm
Forum: Clarifications on Project Euler Problems
Topic: Problem 325
Replies: 7
Views: 3483

Re: Problem 325

Obviously, it's a winning configuration for the first player.
(S)he can win by taking 2*3 = 6 stones from the larger pile. That will leave 3,4 for the other player, which, as stated in the Problem 325 (View Problem) is a losing configuration for the player whose turn is to play.
by harryh
Sat Feb 19, 2011 3:21 pm
Forum: Clarifications on Project Euler Problems
Topic: Problem 260
Replies: 9
Views: 4356

Re: Problem 260

i is the index of the loosing configuration(s). E.g. if (0,1,2) and (1,3,3) are the only losing configurations you need to consider, then you can assing the index i=1 to (0,1,2) and the index i=2 to (1,3,3). (The actual order is of course unimportant). Then, x 1 =0, y 1 =1, z 1 =2, x 2 =1, y 2 =3, ...
by harryh
Thu Feb 17, 2011 4:42 pm
Forum: Clarifications on Project Euler Problems
Topic: Problem 048
Replies: 15
Views: 5161

Re: Problem 048

A. Please don't start a new thread here, if there is already one for the specific problem.

B. W.r.t. efficient methods : I suggest you read through the problem's forum (in the main site), where those who have solved it before you, are discussing their methods.
by harryh
Wed Feb 16, 2011 7:31 am
Forum: Clarifications on Project Euler Problems
Topic: Problem 005
Replies: 49
Views: 14809

Re: Problem 005

Inglonias wrote:.... I looked at the overview, but I didn't understand it.
You can send a PM to me with details of what exactly it is that you don't understand in the pdf.
Then, I might be able to explain it better.
by harryh
Sun Jan 09, 2011 10:21 am
Forum: Clarifications on Project Euler Problems
Topic: Problem 319
Replies: 23
Views: 8098

Re: Problem 319

No, but you are close. Here is the complete list for n=3:

Code: Select all

2 4 8
2 4 9
2 4 10
2 4 11
2 5 11
2 5 12
2 5 13
2 5 14
2 6 14
2 6 15
2 6 16
2 6 17
2 6 18
2 7 18
2 7 19
2 7 20
2 7 21
2 7 22
2 8 22
2 8 23
2 8 24
2 8 25
2 8 26 
You can't ask for more, can you? 8-)
Good luck!
by harryh
Sat Jan 08, 2011 11:08 pm
Forum: Clarifications on Project Euler Problems
Topic: Problem 319
Replies: 23
Views: 8098

Re: Problem 319

starblue wrote:I don't see how {2, 6} satisfies the third condition:

$$2^6=64 \not< 49 = (6+1)^2$$
It does, if you look carefully at Problem 319 (View Problem): the exponents are i and j, not xi and xj.

So, 22<(6+1)1 and 61<(2+1)2, both of which are true.
by harryh
Fri Dec 31, 2010 10:35 am
Forum: Clarifications on Project Euler Problems
Topic: Problem 316
Replies: 32
Views: 14332

Re: Problem 316

Surprisingly this problem has low private-forum-posts/solvers ratio. Perhaps due to fewer ways to solve it? I tend to disagree : Right now, #316 has 97 correct answers and 25 posts, #314 has 95 correct solutions and 22 posts, #311 has 108 correct solutions and 35 posts, #312 has 182 correct solutio...
by harryh
Mon Dec 27, 2010 6:41 pm
Forum: Clarifications on Project Euler Problems
Topic: Problem 316
Replies: 32
Views: 14332

Re: Problem 316

@texane : There seem to be at least two errors in your code: (a) When state==1 && n==5, the inner loop returns state=0. Imo, it should return state=1. (b) When 535 is eventually found and you break out of the inner loop the variable "count" is not the index of the first digit, as the problem states...
by harryh
Fri Dec 03, 2010 4:25 pm
Forum: Clarifications on Project Euler Problems
Topic: problem 307
Replies: 16
Views: 5675

Re: problem 307

@mukeshtiwari : Yes, there is something wrong with your logic: as stijn263 said, the probabilities of the arrangements you have listed are not equal. Consider the following: If you throw two normal dice, there are 11 possible values for their sum: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 and 12. Does that mea...
by harryh
Wed Dec 01, 2010 10:21 am
Forum: Clarifications on Project Euler Problems
Topic: Problem 189
Replies: 9
Views: 3994

Re: Problem 189

Yes, your answer for 16 triangles, seems to be correct :)
by harryh
Thu Nov 25, 2010 8:00 pm
Forum: Clarifications on Project Euler Problems
Topic: Problem 003
Replies: 128
Views: 42558

Re: Problem 003

I suggest you try the Sieve of Eratosthenes and some of its variants / improvements. You'll suprised !
by harryh
Mon Nov 15, 2010 7:16 am
Forum: Programming languages
Topic: c++ numbers out of range
Replies: 9
Views: 6438

Re: c++ numbers out of range

Welcome to PE latinpower! C++ also has 64-bit integers ("long long" or "__int64" depending on which implementation you use). As a principle, you don't need any bigInt or bigNum libraries to solve the PE problems (but you do need to know the limitations imposed by each type and take those limitations...