Each time you need to either place the new bag inside the cupboard empty, or place bags inside the new bag.

This means that your example 7 is invalid because in step D you cannot put bags into bag 1 (as it is not the new bag).

## Search found 54 matches

- Mon Apr 27, 2020 10:12 pm
- Forum: Clarifications on Project Euler Problems
- Topic: Problem 709 - Even Stevens
- Replies:
**3** - Views:
**549**

- Mon Apr 27, 2020 8:11 pm
- Forum: Clarifications on Project Euler Problems
- Topic: Problem 709 - Even Stevens
- Replies:
**3** - Views:
**549**

### Re: Problem 709 - Even Stevens

Packaging 2 and 4 are built up in different ways. 2 comes from: A) place bag 1 inside B) place bag 2 inside C) place 1 and 2 in bag 3 D) place bag 4 inside 4 comes from: A) place bag 1 inside B) place bag 2 inside C) place bag 3 inside D) place bag 1 and 2 in bag 4 In other words, you are right that...

- Sun Apr 12, 2020 8:47 am
- Forum: Clarifications on Project Euler Problems
- Topic: Problem 710
- Replies:
**1** - Views:
**610**

### Re: Problem 710

(2,16,2) is a twopal for 20 (tuple is palindromic and 2 is present).

(4,12,4) is not (no element equal to 2).

(20) is not (no element equal to 2).

In Python, a test for a twopal could be written as:

(4,12,4) is not (no element equal to 2).

(20) is not (no element equal to 2).

In Python, a test for a twopal could be written as:

Code: Select all

```
A=(2,16,2)
is_twopal = (A == A[::-1]) and (2 in A)
```

- Wed Nov 08, 2017 7:40 pm
- Forum: Discrete Mathematics
- Topic: Finding shortest subarray with given value: many queries
- Replies:
**2** - Views:
**6378**

### Finding shortest subarray with given value: many queries

Background I came across this interesting stack overflow question: https://stackoverflow.com/questions/47111546/finding-smallest-subarray-lengths-for-given-multiple-queries#comment81192683_47111546 Question There is an array n = 1 million in length containing positive integers. There are also n = 1...

- Sun Feb 21, 2016 1:12 pm
- Forum: Clarifications on Project Euler Problems
- Topic: Problem 548
- Replies:
**5** - Views:
**2463**

### Problem 548

Can you also give the value for g(1)?

I am not sure from the problem statement whether g(1) should be 0 or 1?

I am not sure from the problem statement whether g(1) should be 0 or 1?

- Tue Apr 28, 2015 10:40 pm
- Forum: News, Suggestions, and FAQ
- Topic: Errors/Warnings/Bugs
- Replies:
**539** - Views:
**123308**

### Re: Errors/Warnings/Bugs

I've just enjoyed solving problem 459 (after a year and a bit) but noticed a slightly curious thing when looking to see how quickly others had managed to solve it: The fastest solvers list for Problem 459 only mentions 61 people, while the archives page lists 114 people as having solved it. Is this ...

- Tue Aug 26, 2014 7:20 pm
- Forum: Game Theory
- Topic: Optimal strategy for a game on a binary tree
- Replies:
**0** - Views:
**7598**

### Optimal strategy for a game on a binary tree

I have been struggling to solve a problem from CodeForces involving the optimal strategy for a two player game played on a tree. (This is a problem from a finished contest - but no editorial has been published yet as far as I can see.) I have put a description of the problem on Stack Overflow http:/...

- Tue Mar 04, 2014 7:37 pm
- Forum: News, Suggestions, and FAQ
- Topic: Where's my badge? :)
- Replies:
**12** - Views:
**4010**

### Re: Where's my badge? :)

Incidentally, I notice that I have now lost my perfection badge

I guess the system spotted I have been getting lazy recently and not attempting many problems...

I guess the system spotted I have been getting lazy recently and not attempting many problems...

- Sat Dec 28, 2013 1:59 pm
- Forum: News, Suggestions, and FAQ
- Topic: Credits for Authors of problems
- Replies:
**7** - Views:
**3187**

### Credits for Authors of problems

I was just wondering whether it would be good to note somewhere who suggested each problem? It might show a bit of appreciation to those able to come up with the problems, and solvers might be able to start recognising the names of problem setters whose questions they enjoy, perhaps helping them whe...

- Sun Jan 13, 2013 7:50 pm
- Forum: News, Suggestions, and FAQ
- Topic: Posting solutions outside of Project Euler's site
- Replies:
**25** - Views:
**12955**

### Re: Posting solutions outside of Project Euler's site

For what it's worth, I would prefer there not be such limits before people can solve recent problems. If I recommend Project Euler to someone who wants to learn a new language then I suggest starting from the easiest problems, but if someone just wants to have fun and play with solving some mathemat...

- Sun Sep 16, 2012 6:09 pm
- Forum: Clarifications on Project Euler Problems
- Topic: problem 394
- Replies:
**7** - Views:
**2698**

### Re: problem 394

I wonder if you are thinking about the problem like a game where Jeff is choosing where to make the cuts? In this case you are correct, and Jeff can "win" the game on his first move by cutting off most of the cake. However, this is not the intention of the problem. It is better to think of it as a s...

- Mon Jun 11, 2012 10:00 am
- Forum: Recreational
- Topic: Have you written a program to write a program?
- Replies:
**7** - Views:
**4822**

### Re: Have you written a program to write a program?

I use this kind of metaprogramming quite often when I need to write in hardware description languages (such as Verilog or VHDL) because these languages are relatively verbose. However, my preferred direction is opposite to yours - I tend to write Python code to generate the RTL output. I find my met...

- Sat May 19, 2012 9:10 pm
- Forum: Applied Mathematics
- Topic: Physics Problem
- Replies:
**4** - Views:
**9009**

### Re: Physics Problem

One argument is that air resistance will increase non-linearly with speed, so the ball going through the trough might be expected to be faster and meet with more air resistance, and come out slower.

However, this is likely to be a negligible effect so probably the proper answer is something else?

However, this is likely to be a negligible effect so probably the proper answer is something else?

- Sun May 13, 2012 8:54 pm
- Forum: News, Suggestions, and FAQ
- Topic: how to add the solution
- Replies:
**1** - Views:
**2748**

### Re: how to add the solution

Welcome! In Project Euler you just need to submit the numerical answer not the code. Type the answer you found in the box labelled Answer. Type the 5 digit number shown in the image in the box labelled Confirmation Code. Press the Check button. You will then get a green tick (if the answer is right)...

- Wed Mar 28, 2012 2:46 pm
- Forum: Resources
- Topic: Resources for Programming Competitions?
- Replies:
**4** - Views:
**10544**

### Re: Resources for Programming Competitions?

There are some good tutorial articles at http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=alg_index . It is also worth reading the editorials for past competitions as these contain worked solutions for all their competition problems. http://apps.topcoder.com/wiki/display/tc/Algorithm+P...

- Sun Mar 18, 2012 2:37 pm
- Forum: Clarifications on Project Euler Problems
- Topic: Problem 376
- Replies:
**21** - Views:
**5829**

### Re: problem 376 clarification

I also misread the question initially so here is a clarification that would have helped me and I hope is not considered to spoil the question. Suppose A has a probability of 20% of winning, and a probability of 10% of losing, and there is a 70% probability of a draw. In this case A does NOT have a >...

- Sat Dec 31, 2011 7:15 pm
- Forum: Clarifications on Project Euler Problems
- Topic: Problem 050
- Replies:
**42** - Views:
**14214**

### Re: Project 50

The sum does not have to start with 2.

e.g. 7+11+13 = 31 would be another example.

e.g. 7+11+13 = 31 would be another example.

- Sat Dec 31, 2011 5:04 pm
- Forum: News, Suggestions, and FAQ
- Topic: Can't see new problem
- Replies:
**6** - Views:
**2875**

### Re: Can't see new problem

Works for me now.

- Sat Dec 31, 2011 4:24 pm
- Forum: News, Suggestions, and FAQ
- Topic: Can't see new problem
- Replies:
**6** - Views:
**2875**

### Re: Can't see new problem

Same for me, perhaps someone could post the problem here if they can see it?

- Tue Dec 06, 2011 10:20 pm
- Forum: Recreational
- Topic: Exceptionally difficult questions
- Replies:
**2** - Views:
**3226**

### Re: Exceptionally difficult questions

Thank you very much for your reply, this satisifes my curiosity. (Although I was kind of hoping that someone had suggested a problem (and worked solution) along the lines "What is the smallest N such that if the integers {1, 2, ..., N} are colored, each with one of 2 different colors, then there are...