From c8ef4db1628446ead0edff9d5e3d5810da92cede Mon Sep 17 00:00:00 2001 From: Jacob Magnuson Date: Fri, 17 Feb 2017 07:11:05 +0000 Subject: [PATCH] begin things-dont-add-up --- things-add-up/problem.yml | 2 +- things-dont-add-up/description.md | 34 +++++++++++++++++++++++++++++++ things-dont-add-up/generator.py | 1 + things-dont-add-up/grader.py | 1 + things-dont-add-up/problem.yml | 6 ++++++ 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 things-dont-add-up/description.md create mode 100644 things-dont-add-up/generator.py create mode 100644 things-dont-add-up/grader.py create mode 100644 things-dont-add-up/problem.yml diff --git a/things-add-up/problem.yml b/things-add-up/problem.yml index dc3bf0b..02eefe1 100644 --- a/things-add-up/problem.yml +++ b/things-add-up/problem.yml @@ -7,4 +7,4 @@ value: 15 test_cases: 10 time_limit: 1000 -memory_limit: 256000 \ No newline at end of file +memory_limit: 256000 diff --git a/things-dont-add-up/description.md b/things-dont-add-up/description.md new file mode 100644 index 0000000..00b2589 --- /dev/null +++ b/things-dont-add-up/description.md @@ -0,0 +1,34 @@ +Mikel is going out for McDawnald's, and he has some very specific dietary restrictions - he can only eat certain amounts of chicken nuggets! He's a pretty secretive dude, so he won't +tell you in advance which amounts he can and cannot eat. However, you've known Mikel for years, so you know he eats between `A` and `B` chicken nuggets (inclusive) during any given McDawnald's visit. + +The McDawnald's you're going to sells nuggets in `N` different amounts, and because Mikel is thrifty and broke from running a CTF, he will eat every single nugget that is purchased - that is, +there must be no nuggets left over. Once you get to McDawnald's, Mikel will tell you how many nuggets he wants to eat, but you need to be ready for anything, so your task is as follows: + +Given a range `[A, B]` from which Mikel's required nugget count will be chosen from, count the number of potential nugget orders which will be impossible to fulfill given the McDawnald's different +nugget serving amounts. + +The first line contains three integers `A B N`. The second line contains a series of `N` integers `d_1, d_2, ..., d_N`, representing all of the different nugget amounts. Output a single integer, the answer to the problem above. + +#### Input Constraints + +`0 < N < 16` + +`0 < A < B < 10000000` + +`0 < d_i < 10000000` + +#### Sample Input + +``` +8 15 3 +4 9 11 +``` + +#### Sample Output + +`2` + +#### Explanation + +By some combination of nuggets, all but 2 total amounts in the range `[8, 15]` can be constructed. For example, you can buy 13 nuggets by getting an order of 9 and an order of 4, as `13 = 4 + 9`. However, +there is no way to create a plate of either 10 or 11 nuggets. That's two impossible amounts, so we output `2`. \ No newline at end of file diff --git a/things-dont-add-up/generator.py b/things-dont-add-up/generator.py new file mode 100644 index 0000000..f87f5c1 --- /dev/null +++ b/things-dont-add-up/generator.py @@ -0,0 +1 @@ +# TODO \ No newline at end of file diff --git a/things-dont-add-up/grader.py b/things-dont-add-up/grader.py new file mode 100644 index 0000000..f87f5c1 --- /dev/null +++ b/things-dont-add-up/grader.py @@ -0,0 +1 @@ +# TODO \ No newline at end of file diff --git a/things-dont-add-up/problem.yml b/things-dont-add-up/problem.yml new file mode 100644 index 0000000..56794b6 --- /dev/null +++ b/things-dont-add-up/problem.yml @@ -0,0 +1,6 @@ +author: blockingthesky +title: Things Don't Add Up +category: Programming +autogen: false +programming: true +value: 280 \ No newline at end of file