From f41eb99256d6d5191788dadcfb0540c4fdd5bd7d Mon Sep 17 00:00:00 2001 From: flifloo Date: Sun, 1 Dec 2019 15:06:01 +0100 Subject: [PATCH] Day 1, P2 test --- 2019/day 1/{Part one => P1}/input.txt | 0 2019/day 1/{Part one => P1}/requirements.py | 0 2019/day 1/P2/input.txt | 100 ++++++++++++++++++++ 2019/day 1/P2/requirements.py | 8 ++ 4 files changed, 108 insertions(+) rename 2019/day 1/{Part one => P1}/input.txt (100%) rename 2019/day 1/{Part one => P1}/requirements.py (100%) create mode 100644 2019/day 1/P2/input.txt create mode 100644 2019/day 1/P2/requirements.py diff --git a/2019/day 1/Part one/input.txt b/2019/day 1/P1/input.txt similarity index 100% rename from 2019/day 1/Part one/input.txt rename to 2019/day 1/P1/input.txt diff --git a/2019/day 1/Part one/requirements.py b/2019/day 1/P1/requirements.py similarity index 100% rename from 2019/day 1/Part one/requirements.py rename to 2019/day 1/P1/requirements.py diff --git a/2019/day 1/P2/input.txt b/2019/day 1/P2/input.txt new file mode 100644 index 0000000..eb14a40 --- /dev/null +++ b/2019/day 1/P2/input.txt @@ -0,0 +1,100 @@ +60052 +61005 +114258 +66223 +114571 +80949 +129508 +94463 +134331 +102634 +148109 +109532 +60479 +68048 +71553 +68053 +51105 +149024 +138472 +57246 +85686 +121267 +144206 +104420 +149858 +137795 +121637 +68877 +51560 +74506 +83362 +53806 +132871 +100629 +76102 +103594 +68425 +54734 +124930 +120598 +136375 +146892 +90876 +131455 +124377 +125244 +144563 +107469 +86940 +132916 +79789 +136359 +105127 +82810 +83751 +107741 +51677 +113598 +119741 +105174 +128151 +82407 +108461 +50594 +92897 +146520 +56176 +68640 +124300 +88250 +132105 +89023 +80532 +120433 +50015 +84028 +100491 +53131 +135920 +108820 +98932 +109750 +136854 +126902 +108231 +109391 +136727 +128359 +108575 +114594 +131466 +89977 +124467 +114318 +84544 +53584 +87786 +131991 +138445 +70673 diff --git a/2019/day 1/P2/requirements.py b/2019/day 1/P2/requirements.py new file mode 100644 index 0000000..8d4dfd2 --- /dev/null +++ b/2019/day 1/P2/requirements.py @@ -0,0 +1,8 @@ +modules = open("input.txt").read().split("\n")[:-1] +requirement = 0 +for i in modules: + fule=(int(i)//3)-2 + while fule > 0: + requirement+=fule + fule=(fule//3)-2 +print(requirement)