diff --git a/01 - Hello Greg/0.txt b/01 - Hello Greg/0.txt new file mode 100644 index 0000000..e69de29 diff --git a/01 - Hello Greg/1.txt b/01 - Hello Greg/1.txt new file mode 100644 index 0000000..e69de29 diff --git a/01 - Hello Greg/2.txt b/01 - Hello Greg/2.txt new file mode 100644 index 0000000..e69de29 diff --git a/01 - Hello Greg/3.txt b/01 - Hello Greg/3.txt new file mode 100644 index 0000000..e69de29 diff --git a/01 - Hello Greg/4.txt b/01 - Hello Greg/4.txt new file mode 100644 index 0000000..e69de29 diff --git a/01 - Hello Greg/5.txt b/01 - Hello Greg/5.txt new file mode 100644 index 0000000..e69de29 diff --git a/01 - Hello Greg/6.txt b/01 - Hello Greg/6.txt new file mode 100644 index 0000000..e69de29 diff --git a/01 - Hello Greg/7.txt b/01 - Hello Greg/7.txt new file mode 100644 index 0000000..e69de29 diff --git a/01 - Hello Greg/8.txt b/01 - Hello Greg/8.txt new file mode 100644 index 0000000..e69de29 diff --git a/01 - Hello Greg/9.txt b/01 - Hello Greg/9.txt new file mode 100644 index 0000000..e69de29 diff --git a/01 - Hello Greg/main.py b/01 - Hello Greg/main.py new file mode 100644 index 0000000..93b8dbc --- /dev/null +++ b/01 - Hello Greg/main.py @@ -0,0 +1 @@ +print('Hello Greg') \ No newline at end of file diff --git a/02 - Muffling Masks/0.txt b/02 - Muffling Masks/0.txt new file mode 100644 index 0000000..7917838 --- /dev/null +++ b/02 - Muffling Masks/0.txt @@ -0,0 +1 @@ +freddy \ No newline at end of file diff --git a/02 - Muffling Masks/1.txt b/02 - Muffling Masks/1.txt new file mode 100644 index 0000000..663e4eb --- /dev/null +++ b/02 - Muffling Masks/1.txt @@ -0,0 +1 @@ +Hello Greg #2 \ No newline at end of file diff --git a/02 - Muffling Masks/2.txt b/02 - Muffling Masks/2.txt new file mode 100644 index 0000000..5003834 --- /dev/null +++ b/02 - Muffling Masks/2.txt @@ -0,0 +1 @@ +How are you doing on this fine day, sir? \ No newline at end of file diff --git a/02 - Muffling Masks/3.txt b/02 - Muffling Masks/3.txt new file mode 100644 index 0000000..3c0fb10 --- /dev/null +++ b/02 - Muffling Masks/3.txt @@ -0,0 +1 @@ +Would you like to sign up for QuHacks 2020? \ No newline at end of file diff --git a/02 - Muffling Masks/4.txt b/02 - Muffling Masks/4.txt new file mode 100644 index 0000000..dad09da --- /dev/null +++ b/02 - Muffling Masks/4.txt @@ -0,0 +1 @@ +Nice weather we're having today, wouldn't you say? \ No newline at end of file diff --git a/02 - Muffling Masks/5.txt b/02 - Muffling Masks/5.txt new file mode 100644 index 0000000..5542497 --- /dev/null +++ b/02 - Muffling Masks/5.txt @@ -0,0 +1 @@ +Quack Quack I'm A Duck And I Say Quack Quack \ No newline at end of file diff --git a/02 - Muffling Masks/6.txt b/02 - Muffling Masks/6.txt new file mode 100644 index 0000000..88a1f25 --- /dev/null +++ b/02 - Muffling Masks/6.txt @@ -0,0 +1 @@ +Fun fact: newline characters are often displayed as \n in text \ No newline at end of file diff --git a/02 - Muffling Masks/7.txt b/02 - Muffling Masks/7.txt new file mode 100644 index 0000000..b462afc --- /dev/null +++ b/02 - Muffling Masks/7.txt @@ -0,0 +1 @@ +Coming up with random conversation starters to make test cases is hard, okay? \ No newline at end of file diff --git a/02 - Muffling Masks/8.txt b/02 - Muffling Masks/8.txt new file mode 100644 index 0000000..bfd3e75 --- /dev/null +++ b/02 - Muffling Masks/8.txt @@ -0,0 +1 @@ +<(`v`)> <(quack) \ No newline at end of file diff --git a/02 - Muffling Masks/9.txt b/02 - Muffling Masks/9.txt new file mode 100644 index 0000000..8039d30 --- /dev/null +++ b/02 - Muffling Masks/9.txt @@ -0,0 +1 @@ +01234567890!@#$%^&*() \ No newline at end of file diff --git a/02 - Muffling Masks/main.py b/02 - Muffling Masks/main.py new file mode 100644 index 0000000..23f2b1f --- /dev/null +++ b/02 - Muffling Masks/main.py @@ -0,0 +1,4 @@ +import sys + +string = sys.stdin.read() #reads the entire input +print(string) \ No newline at end of file diff --git a/03 - Duck Donuts/0.txt b/03 - Duck Donuts/0.txt new file mode 100644 index 0000000..cade821 --- /dev/null +++ b/03 - Duck Donuts/0.txt @@ -0,0 +1,5 @@ +3 +Vanilla +Chocolate +Strawberry +2 \ No newline at end of file diff --git a/03 - Duck Donuts/1.txt b/03 - Duck Donuts/1.txt new file mode 100644 index 0000000..79319e7 --- /dev/null +++ b/03 - Duck Donuts/1.txt @@ -0,0 +1,4 @@ +2 +Boston Cream +Powdered Sugar +2 \ No newline at end of file diff --git a/03 - Duck Donuts/2.txt b/03 - Duck Donuts/2.txt new file mode 100644 index 0000000..8f5b4c8 --- /dev/null +++ b/03 - Duck Donuts/2.txt @@ -0,0 +1,5 @@ +3 +Red +Blue +Green +1 \ No newline at end of file diff --git a/03 - Duck Donuts/3.txt b/03 - Duck Donuts/3.txt new file mode 100644 index 0000000..be942d5 --- /dev/null +++ b/03 - Duck Donuts/3.txt @@ -0,0 +1,6 @@ +4 +Doughnut +Donut +Noughdut +Nodut +4 \ No newline at end of file diff --git a/03 - Duck Donuts/4.txt b/03 - Duck Donuts/4.txt new file mode 100644 index 0000000..d751213 --- /dev/null +++ b/03 - Duck Donuts/4.txt @@ -0,0 +1,12 @@ +10 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +5 \ No newline at end of file diff --git a/03 - Duck Donuts/5.txt b/03 - Duck Donuts/5.txt new file mode 100644 index 0000000..af00651 --- /dev/null +++ b/03 - Duck Donuts/5.txt @@ -0,0 +1,5 @@ +3 +:) +:( +:| +1 \ No newline at end of file diff --git a/03 - Duck Donuts/6.txt b/03 - Duck Donuts/6.txt new file mode 100644 index 0000000..a112d86 --- /dev/null +++ b/03 - Duck Donuts/6.txt @@ -0,0 +1,12 @@ +10 +Never +gonna +give +you +up +Never +gonna +let +you +down +6 \ No newline at end of file diff --git a/03 - Duck Donuts/7.txt b/03 - Duck Donuts/7.txt new file mode 100644 index 0000000..73732bf --- /dev/null +++ b/03 - Duck Donuts/7.txt @@ -0,0 +1,28 @@ +26 +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +p +q +r +s +t +u +v +w +x +y +z +12 \ No newline at end of file diff --git a/03 - Duck Donuts/8.txt b/03 - Duck Donuts/8.txt new file mode 100644 index 0000000..c7db9d7 --- /dev/null +++ b/03 - Duck Donuts/8.txt @@ -0,0 +1,3 @@ +1 +Freddy is #1 +1 \ No newline at end of file diff --git a/03 - Duck Donuts/9.txt b/03 - Duck Donuts/9.txt new file mode 100644 index 0000000..468862d --- /dev/null +++ b/03 - Duck Donuts/9.txt @@ -0,0 +1,38 @@ +36 +Lorem +ipsum +dolor +sit +amet, +consectetur +adipiscing +elit, +sed +do +eiusmod +tempor +incididunt +ut +labore +et +dolore +magna +aliqua. +Ut +enim +ad +minim +veniam, +quis +nostrud +exercitation +ullamco +laboris +nisi +ut +aliquip +ex +ea +commodo +consequat. +33 \ No newline at end of file diff --git a/03 - Duck Donuts/main.py b/03 - Duck Donuts/main.py new file mode 100644 index 0000000..e15b9e4 --- /dev/null +++ b/03 - Duck Donuts/main.py @@ -0,0 +1,7 @@ +import sys + +lines = sys.stdin.readlines() +count = lines[0] #first line +index = lines[int(count) + 1] #last line +donut = lines[int(index)] #answer +print(donut) \ No newline at end of file diff --git a/04 - Color Counting/0.txt b/04 - Color Counting/0.txt new file mode 100644 index 0000000..bf4b593 --- /dev/null +++ b/04 - Color Counting/0.txt @@ -0,0 +1,5 @@ +4 12 +5 +10 +15 +20 \ No newline at end of file diff --git a/04 - Color Counting/1.txt b/04 - Color Counting/1.txt new file mode 100644 index 0000000..ad763a4 --- /dev/null +++ b/04 - Color Counting/1.txt @@ -0,0 +1,3 @@ +2 2 +1 +2 \ No newline at end of file diff --git a/04 - Color Counting/2.txt b/04 - Color Counting/2.txt new file mode 100644 index 0000000..8fef6fb --- /dev/null +++ b/04 - Color Counting/2.txt @@ -0,0 +1,7 @@ +6 5 +1 +5 +2 +10 +0 +12 \ No newline at end of file diff --git a/04 - Color Counting/3.txt b/04 - Color Counting/3.txt new file mode 100644 index 0000000..f020588 --- /dev/null +++ b/04 - Color Counting/3.txt @@ -0,0 +1,4 @@ +3 10 +10 +20 +0 \ No newline at end of file diff --git a/04 - Color Counting/4.txt b/04 - Color Counting/4.txt new file mode 100644 index 0000000..9b56740 --- /dev/null +++ b/04 - Color Counting/4.txt @@ -0,0 +1,5 @@ +4 3 +0 +0 +0 +0 \ No newline at end of file diff --git a/04 - Color Counting/5.txt b/04 - Color Counting/5.txt new file mode 100644 index 0000000..55d5044 --- /dev/null +++ b/04 - Color Counting/5.txt @@ -0,0 +1,7 @@ +6 4 +1 +2 +4 +8 +16 +32 \ No newline at end of file diff --git a/04 - Color Counting/6.txt b/04 - Color Counting/6.txt new file mode 100644 index 0000000..c5abb38 --- /dev/null +++ b/04 - Color Counting/6.txt @@ -0,0 +1,9 @@ +8 1 +0 +1 +0 +0 +1 +1 +0 +0 \ No newline at end of file diff --git a/04 - Color Counting/7.txt b/04 - Color Counting/7.txt new file mode 100644 index 0000000..7cf2f8d --- /dev/null +++ b/04 - Color Counting/7.txt @@ -0,0 +1,27 @@ +26 4 +1 +5 +2 +7 +3 +6 +3 +2 +5 +3 +2 +2 +7 +3 +2 +6 +4 +2 +5 +2 +6 +8 +4 +2 +7 +3 \ No newline at end of file diff --git a/04 - Color Counting/8.txt b/04 - Color Counting/8.txt new file mode 100644 index 0000000..b22a2a0 --- /dev/null +++ b/04 - Color Counting/8.txt @@ -0,0 +1,21 @@ +20 100 +12 +380 +49 +123 +4 +95 +69 +355 +47 +810 +56 +278 +9 +13 +431 +28 +95 +712 +30 +48 \ No newline at end of file diff --git a/04 - Color Counting/9.txt b/04 - Color Counting/9.txt new file mode 100644 index 0000000..9d7179a --- /dev/null +++ b/04 - Color Counting/9.txt @@ -0,0 +1,6 @@ +5 193047 +105624 +147925 +207852 +198720 +193048 \ No newline at end of file diff --git a/04 - Color Counting/main.py b/04 - Color Counting/main.py new file mode 100644 index 0000000..aead16e --- /dev/null +++ b/04 - Color Counting/main.py @@ -0,0 +1,11 @@ +import sys + +#reads the first line and uses .split() to get multiple numbers +colors, needed = sys.stdin.readline().split() + +count = 0 +for i in range(int(colors)): #loops over every color + color = sys.stdin.readline() #reads the next line + if int(color) >= int(needed): #checks if there's enough fabric + count += 1 #adds one to count if there is +print(count) \ No newline at end of file diff --git a/05 - Charitable Donation/0.txt b/05 - Charitable Donation/0.txt new file mode 100644 index 0000000..22e834a --- /dev/null +++ b/05 - Charitable Donation/0.txt @@ -0,0 +1,5 @@ +4 +Freddie 7 +Fred 4 +Frederick 9 +Frederico 8 \ No newline at end of file diff --git a/05 - Charitable Donation/1.txt b/05 - Charitable Donation/1.txt new file mode 100644 index 0000000..bf3bd35 --- /dev/null +++ b/05 - Charitable Donation/1.txt @@ -0,0 +1,4 @@ +3 +Alpha 0 +Bravo 1 +Charlie 2 \ No newline at end of file diff --git a/05 - Charitable Donation/2.txt b/05 - Charitable Donation/2.txt new file mode 100644 index 0000000..d461bd5 --- /dev/null +++ b/05 - Charitable Donation/2.txt @@ -0,0 +1,2 @@ +1 +Greg 1000 \ No newline at end of file diff --git a/05 - Charitable Donation/3.txt b/05 - Charitable Donation/3.txt new file mode 100644 index 0000000..81808bf --- /dev/null +++ b/05 - Charitable Donation/3.txt @@ -0,0 +1,6 @@ +5 +A 1 +B 4 +C 2 +D 5 +E 3 \ No newline at end of file diff --git a/05 - Charitable Donation/4.txt b/05 - Charitable Donation/4.txt new file mode 100644 index 0000000..6089eb3 --- /dev/null +++ b/05 - Charitable Donation/4.txt @@ -0,0 +1,3 @@ +5 +4 3 +2 1 \ No newline at end of file diff --git a/05 - Charitable Donation/5.txt b/05 - Charitable Donation/5.txt new file mode 100644 index 0000000..29a9996 --- /dev/null +++ b/05 - Charitable Donation/5.txt @@ -0,0 +1,7 @@ +6 +Freddy 1007 +Freddie 1070 +Freddi 1700 +Fredy 7001 +Fredie 701 +Fredi 71 \ No newline at end of file diff --git a/05 - Charitable Donation/6.txt b/05 - Charitable Donation/6.txt new file mode 100644 index 0000000..f372c7f --- /dev/null +++ b/05 - Charitable Donation/6.txt @@ -0,0 +1,26 @@ +25 +Sophia 26 +Olivia 12 +Riley 48 +Emma 19 +Ava 25 +Isabella 85 +Aria 44 +Aaliyah 72 +Amelia 4 +Mia 19 +Layla 63 +Zoe 81 +Camilla 91 +Charlotte 34 +Eliana 43 +Mila 51 +Everly 52 +Luna 14 +Avery 32 +Evelyn 56 +Harper 76 +Lily 67 +Ella 87 +Gianna 22 +Chloe 31 \ No newline at end of file diff --git a/05 - Charitable Donation/7.txt b/05 - Charitable Donation/7.txt new file mode 100644 index 0000000..1d2f0fb --- /dev/null +++ b/05 - Charitable Donation/7.txt @@ -0,0 +1,26 @@ +25 +Liam 102 +Noah 502 +Jackson 106 +Aiden 286 +Elijah 120 +Grayson 238 +Lucas 96 +Oliver 105 +Caden 132 +Mateo 126 +Muhammad 301 +Mason 482 +Carter 311 +Jayden 121 +Ethan 99 +Sebastian 116 +James 196 +Michael 182 +Benjamin 306 +Logan 482 +Leo 163 +Luca 231 +Alexander 477 +Levi 185 +Daniel 601 \ No newline at end of file diff --git a/05 - Charitable Donation/8.txt b/05 - Charitable Donation/8.txt new file mode 100644 index 0000000..0222727 --- /dev/null +++ b/05 - Charitable Donation/8.txt @@ -0,0 +1,21 @@ +20 +12 21 +380 830 +49 94 +123 321 +44 44 +95 59 +69 96 +355 533 +47 74 +810 18 +56 65 +278 872 +99 99 +13 31 +431 134 +28 82 +95 59 +712 217 +30 3 +48 84 \ No newline at end of file diff --git a/05 - Charitable Donation/9.txt b/05 - Charitable Donation/9.txt new file mode 100644 index 0000000..4ce586c --- /dev/null +++ b/05 - Charitable Donation/9.txt @@ -0,0 +1,11 @@ +10 +Erjiosd 1408192 +Vnsjflr 4580431 +Rweojhs 2789123 +Sdftuio 1297824 +9weiojf 2305891 +Asdfnkl 1309461 +Irowjsf 1061239 +Nfadosj 6894302 +Eioqwrj 1230948 +Freddy 10000000 \ No newline at end of file diff --git a/05 - Charitable Donation/main.py b/05 - Charitable Donation/main.py new file mode 100644 index 0000000..72b59d4 --- /dev/null +++ b/05 - Charitable Donation/main.py @@ -0,0 +1,11 @@ +import sys + +friends = sys.stdin.readline() #reads the number of friends +answer, minimum = sys.stdin.readline().split() #reads the first friend + +for i in range(int(friends) - 1): #loops over the rest of the friends + name, masks = sys.stdin.readline().split() #reads the friend data + if int(masks) < int(minimum): #compare their masks to the minimum + answer = name #if they have less, + minimum = masks #then they're the new minimum +print(answer) \ No newline at end of file diff --git a/06 - Profit Prediction/0.txt b/06 - Profit Prediction/0.txt new file mode 100644 index 0000000..57d3f99 --- /dev/null +++ b/06 - Profit Prediction/0.txt @@ -0,0 +1,3 @@ +5 +2 +3 \ No newline at end of file diff --git a/06 - Profit Prediction/1.txt b/06 - Profit Prediction/1.txt new file mode 100644 index 0000000..9fbe2cf --- /dev/null +++ b/06 - Profit Prediction/1.txt @@ -0,0 +1,3 @@ +96 +1 +8 \ No newline at end of file diff --git a/06 - Profit Prediction/2.txt b/06 - Profit Prediction/2.txt new file mode 100644 index 0000000..c55eb7a --- /dev/null +++ b/06 - Profit Prediction/2.txt @@ -0,0 +1,3 @@ +0 +1 +2 \ No newline at end of file diff --git a/06 - Profit Prediction/3.txt b/06 - Profit Prediction/3.txt new file mode 100644 index 0000000..22a0f85 --- /dev/null +++ b/06 - Profit Prediction/3.txt @@ -0,0 +1,3 @@ +18 +18 +12 \ No newline at end of file diff --git a/06 - Profit Prediction/4.txt b/06 - Profit Prediction/4.txt new file mode 100644 index 0000000..201c8f3 --- /dev/null +++ b/06 - Profit Prediction/4.txt @@ -0,0 +1,3 @@ +14 +15 +78 \ No newline at end of file diff --git a/06 - Profit Prediction/5.txt b/06 - Profit Prediction/5.txt new file mode 100644 index 0000000..8a86469 --- /dev/null +++ b/06 - Profit Prediction/5.txt @@ -0,0 +1,3 @@ +100 +10 +0 \ No newline at end of file diff --git a/06 - Profit Prediction/6.txt b/06 - Profit Prediction/6.txt new file mode 100644 index 0000000..28ccdc2 --- /dev/null +++ b/06 - Profit Prediction/6.txt @@ -0,0 +1,3 @@ +91230 +10 +356 \ No newline at end of file diff --git a/06 - Profit Prediction/7.txt b/06 - Profit Prediction/7.txt new file mode 100644 index 0000000..ec69b0c --- /dev/null +++ b/06 - Profit Prediction/7.txt @@ -0,0 +1,3 @@ +15639 +16 +4 \ No newline at end of file diff --git a/06 - Profit Prediction/8.txt b/06 - Profit Prediction/8.txt new file mode 100644 index 0000000..5922fb8 --- /dev/null +++ b/06 - Profit Prediction/8.txt @@ -0,0 +1,3 @@ +19420 +158 +18249 \ No newline at end of file diff --git a/06 - Profit Prediction/9.txt b/06 - Profit Prediction/9.txt new file mode 100644 index 0000000..81f7221 --- /dev/null +++ b/06 - Profit Prediction/9.txt @@ -0,0 +1,3 @@ +1925 +1952 +1592 \ No newline at end of file diff --git a/06 - Profit Prediction/main.py b/06 - Profit Prediction/main.py new file mode 100644 index 0000000..9dab01d --- /dev/null +++ b/06 - Profit Prediction/main.py @@ -0,0 +1,5 @@ +import sys + +fabric, needed, price = sys.stdin.readlines() +masks = int(fabric) // int(needed) #the operator // divides and rounds down +print(int(masks) * int(price)) #revenue = number of masks * price of mask \ No newline at end of file diff --git a/07 - Limiting Factors/0.txt b/07 - Limiting Factors/0.txt new file mode 100644 index 0000000..233e21e --- /dev/null +++ b/07 - Limiting Factors/0.txt @@ -0,0 +1,4 @@ +3 +6 2 +8 3 +10 2 \ No newline at end of file diff --git a/07 - Limiting Factors/1.txt b/07 - Limiting Factors/1.txt new file mode 100644 index 0000000..a18ac9a --- /dev/null +++ b/07 - Limiting Factors/1.txt @@ -0,0 +1,5 @@ +4 +10 9 +10 8 +10 5 +10 10 \ No newline at end of file diff --git a/07 - Limiting Factors/2.txt b/07 - Limiting Factors/2.txt new file mode 100644 index 0000000..e957cc6 --- /dev/null +++ b/07 - Limiting Factors/2.txt @@ -0,0 +1,4 @@ +3 +0 2 +2 1 +9 10 \ No newline at end of file diff --git a/07 - Limiting Factors/3.txt b/07 - Limiting Factors/3.txt new file mode 100644 index 0000000..eaf6cfe --- /dev/null +++ b/07 - Limiting Factors/3.txt @@ -0,0 +1,5 @@ +4 +18 2 +10 2 +100 20 +180 20 \ No newline at end of file diff --git a/07 - Limiting Factors/4.txt b/07 - Limiting Factors/4.txt new file mode 100644 index 0000000..1a29b2b --- /dev/null +++ b/07 - Limiting Factors/4.txt @@ -0,0 +1,7 @@ +6 +17 3 +101 20 +16 3 +25 5 +79 15 +96 18 \ No newline at end of file diff --git a/07 - Limiting Factors/5.txt b/07 - Limiting Factors/5.txt new file mode 100644 index 0000000..38f037b --- /dev/null +++ b/07 - Limiting Factors/5.txt @@ -0,0 +1,5 @@ +4 +10 1 +1052 108 +2062 196 +3062 206 \ No newline at end of file diff --git a/07 - Limiting Factors/6.txt b/07 - Limiting Factors/6.txt new file mode 100644 index 0000000..5120ebc --- /dev/null +++ b/07 - Limiting Factors/6.txt @@ -0,0 +1,6 @@ +5 +1 1 +1 10 +1 100 +1 1000 +1 10000 \ No newline at end of file diff --git a/07 - Limiting Factors/7.txt b/07 - Limiting Factors/7.txt new file mode 100644 index 0000000..8fd85cd --- /dev/null +++ b/07 - Limiting Factors/7.txt @@ -0,0 +1,6 @@ +5 +1 1 +10 1 +100 1 +1000 1 +10000 1 \ No newline at end of file diff --git a/07 - Limiting Factors/8.txt b/07 - Limiting Factors/8.txt new file mode 100644 index 0000000..facedb8 --- /dev/null +++ b/07 - Limiting Factors/8.txt @@ -0,0 +1,11 @@ +10 +1904 52 +8249 72 +3452 16 +4523 25 +1204 22 +5348 35 +2348 63 +1238 51 +1039 42 +4139 76 \ No newline at end of file diff --git a/07 - Limiting Factors/9.txt b/07 - Limiting Factors/9.txt new file mode 100644 index 0000000..49e0b4c --- /dev/null +++ b/07 - Limiting Factors/9.txt @@ -0,0 +1,2 @@ +1 +1340652 3 \ No newline at end of file diff --git a/07 - Limiting Factors/main.py b/07 - Limiting Factors/main.py new file mode 100644 index 0000000..a57caee --- /dev/null +++ b/07 - Limiting Factors/main.py @@ -0,0 +1,18 @@ +import sys + +items = sys.stdin.readline() +maximum = 100000 #set the minimum impossibly high +factors = [] #the list of limiting factors + +for i in range(int(items)): #loops over the items + stock, needed = sys.stdin.readline().split() + masks = int(stock) // int(needed) #the operator // divides and rounds down + if masks < maximum: #compare the masks this item makes to the current maximum + factors.clear() #if this item makes less masks, the other items are not limiting factors + maximum = masks #set the new maximum + if masks <= maximum: #this code will run even if the first if statement runs + factors.append(i) #add this item to the limiting factors list + +print(maximum) +for i in factors: #print every limiting factor + print(i) \ No newline at end of file diff --git a/08 - QuackHack/0.txt b/08 - QuackHack/0.txt new file mode 100644 index 0000000..77398c9 --- /dev/null +++ b/08 - QuackHack/0.txt @@ -0,0 +1 @@ +1 7 \ No newline at end of file diff --git a/08 - QuackHack/1.txt b/08 - QuackHack/1.txt new file mode 100644 index 0000000..873b7b3 --- /dev/null +++ b/08 - QuackHack/1.txt @@ -0,0 +1 @@ +24 32 \ No newline at end of file diff --git a/08 - QuackHack/2.txt b/08 - QuackHack/2.txt new file mode 100644 index 0000000..9c65394 --- /dev/null +++ b/08 - QuackHack/2.txt @@ -0,0 +1 @@ +300 301 \ No newline at end of file diff --git a/08 - QuackHack/3.txt b/08 - QuackHack/3.txt new file mode 100644 index 0000000..d24be3b --- /dev/null +++ b/08 - QuackHack/3.txt @@ -0,0 +1 @@ +2 20 \ No newline at end of file diff --git a/08 - QuackHack/4.txt b/08 - QuackHack/4.txt new file mode 100644 index 0000000..2076b88 --- /dev/null +++ b/08 - QuackHack/4.txt @@ -0,0 +1 @@ +16 40 \ No newline at end of file diff --git a/08 - QuackHack/5.txt b/08 - QuackHack/5.txt new file mode 100644 index 0000000..737b344 --- /dev/null +++ b/08 - QuackHack/5.txt @@ -0,0 +1 @@ +100 200 \ No newline at end of file diff --git a/08 - QuackHack/6.txt b/08 - QuackHack/6.txt new file mode 100644 index 0000000..17722f7 --- /dev/null +++ b/08 - QuackHack/6.txt @@ -0,0 +1 @@ +1236 1326 \ No newline at end of file diff --git a/08 - QuackHack/7.txt b/08 - QuackHack/7.txt new file mode 100644 index 0000000..416ce5d --- /dev/null +++ b/08 - QuackHack/7.txt @@ -0,0 +1 @@ +2071 2125 \ No newline at end of file diff --git a/08 - QuackHack/8.txt b/08 - QuackHack/8.txt new file mode 100644 index 0000000..60d8ffe --- /dev/null +++ b/08 - QuackHack/8.txt @@ -0,0 +1 @@ +1 150 \ No newline at end of file diff --git a/08 - QuackHack/9.txt b/08 - QuackHack/9.txt new file mode 100644 index 0000000..dc4afc0 --- /dev/null +++ b/08 - QuackHack/9.txt @@ -0,0 +1 @@ +151515 151617 \ No newline at end of file diff --git a/08 - QuackHack/main.py b/08 - QuackHack/main.py new file mode 100644 index 0000000..9628307 --- /dev/null +++ b/08 - QuackHack/main.py @@ -0,0 +1,13 @@ +import sys + +a, b = sys.stdin.readline().split() + +for i in range(int(a), int(b)): #includes a but not b + number = '' + if i % 3 == 0: #the operator % is modulo (or remainder) + number += 'Quack' + if i % 5 == 0: #if the remainder is 0, it is divisible + number += 'Hack' + if number == '': #if number wasn't divisble by either + number = i + print(number) diff --git a/09 - Profit Log/0.txt b/09 - Profit Log/0.txt new file mode 100644 index 0000000..67727a4 --- /dev/null +++ b/09 - Profit Log/0.txt @@ -0,0 +1,5 @@ +4 +10 +15 +25 +50 \ No newline at end of file diff --git a/09 - Profit Log/1.txt b/09 - Profit Log/1.txt new file mode 100644 index 0000000..d53b34e --- /dev/null +++ b/09 - Profit Log/1.txt @@ -0,0 +1,5 @@ +4 +2 +0 +0 +8 \ No newline at end of file diff --git a/09 - Profit Log/2.txt b/09 - Profit Log/2.txt new file mode 100644 index 0000000..c59d0b3 --- /dev/null +++ b/09 - Profit Log/2.txt @@ -0,0 +1,11 @@ +10 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 \ No newline at end of file diff --git a/09 - Profit Log/3.txt b/09 - Profit Log/3.txt new file mode 100644 index 0000000..a18055c --- /dev/null +++ b/09 - Profit Log/3.txt @@ -0,0 +1,9 @@ +8 +10 +76 +1 +695 +0 +43 +24 +103 \ No newline at end of file diff --git a/09 - Profit Log/4.txt b/09 - Profit Log/4.txt new file mode 100644 index 0000000..4551b90 --- /dev/null +++ b/09 - Profit Log/4.txt @@ -0,0 +1,2 @@ +1 +8 \ No newline at end of file diff --git a/09 - Profit Log/5.txt b/09 - Profit Log/5.txt new file mode 100644 index 0000000..9d1fdeb --- /dev/null +++ b/09 - Profit Log/5.txt @@ -0,0 +1,12 @@ +11 +234 +381 +23 +78 +2 +68 +210 +57 +234 +89 +32 \ No newline at end of file diff --git a/09 - Profit Log/6.txt b/09 - Profit Log/6.txt new file mode 100644 index 0000000..b36bc1c --- /dev/null +++ b/09 - Profit Log/6.txt @@ -0,0 +1,29 @@ +28 +1 +0 +1 +0 +0 +1 +0 +0 +0 +1 +0 +0 +0 +0 +1 +0 +0 +0 +0 +0 +1 +0 +0 +0 +0 +0 +0 +1 \ No newline at end of file diff --git a/09 - Profit Log/7.txt b/09 - Profit Log/7.txt new file mode 100644 index 0000000..a108a74 --- /dev/null +++ b/09 - Profit Log/7.txt @@ -0,0 +1,51 @@ +50 +1260 +420 +0 +1008 +48 +0 +72 +0 +405 +1400 +0 +0 +504 +0 +0 +200 +324 +112 +2205 +0 +2187 +1152 +1260 +768 +480 +504 +0 +90 +30 +0 +256 +1440 +1134 +0 +168 +3024 +0 +2520 +288 +1400 +480 +288 +240 +4608 +36 +252 +96 +972 +72 +252 \ No newline at end of file diff --git a/09 - Profit Log/8.txt b/09 - Profit Log/8.txt new file mode 100644 index 0000000..56589d3 --- /dev/null +++ b/09 - Profit Log/8.txt @@ -0,0 +1,76 @@ +75 +138 +608 +708 +165 +6 +6 +191 +905 +270 +293 +34 +366 +587 +491 +599 +772 +748 +21 +868 +438 +290 +871 +787 +465 +305 +439 +414 +654 +77 +474 +664 +810 +882 +693 +344 +352 +670 +563 +718 +402 +515 +690 +980 +773 +946 +473 +726 +884 +959 +571 +336 +617 +475 +129 +494 +548 +756 +652 +899 +13 +242 +327 +780 +187 +77 +564 +700 +713 +657 +748 +287 +565 +16 +577 +454 \ No newline at end of file diff --git a/09 - Profit Log/9.txt b/09 - Profit Log/9.txt new file mode 100644 index 0000000..1c7595e --- /dev/null +++ b/09 - Profit Log/9.txt @@ -0,0 +1,101 @@ +100 +55 +27 +47 +27 +19 +39 +64 +88 +31 +97 +71 +4 +36 +43 +15 +79 +8 +27 +53 +27 +87 +51 +76 +10 +46 +87 +97 +8 +33 +1 +51 +95 +10 +63 +36 +70 +64 +58 +19 +42 +23 +69 +7 +38 +96 +8 +8 +31 +85 +8 +12 +0 +48 +1 +61 +4 +91 +23 +16 +58 +66 +70 +22 +83 +84 +16 +25 +56 +29 +65 +77 +46 +74 +27 +40 +38 +61 +24 +41 +40 +83 +77 +29 +3 +46 +66 +96 +1 +44 +10 +85 +86 +57 +93 +0 +22 +49 +88 +54 +65 \ No newline at end of file diff --git a/09 - Profit Log/main.py b/09 - Profit Log/main.py new file mode 100644 index 0000000..2947216 --- /dev/null +++ b/09 - Profit Log/main.py @@ -0,0 +1,8 @@ +import sys + +days = sys.stdin.readline() +total = 0 + +for i in range(int(days)): + total += int(sys.stdin.readline()) #adds every day's revenue to the total + print(total) #prints the total after each day \ No newline at end of file diff --git a/10 - Inventory/0.txt b/10 - Inventory/0.txt new file mode 100644 index 0000000..955ed0f --- /dev/null +++ b/10 - Inventory/0.txt @@ -0,0 +1,5 @@ +2 +3 +1 4 5 +8 +3 2 6 7 9 3 2 4 \ No newline at end of file diff --git a/10 - Inventory/1.txt b/10 - Inventory/1.txt new file mode 100644 index 0000000..54fb293 --- /dev/null +++ b/10 - Inventory/1.txt @@ -0,0 +1,7 @@ +3 +2 +12 16 +3 +8 8 8 +4 +10 4 2 6 \ No newline at end of file diff --git a/10 - Inventory/2.txt b/10 - Inventory/2.txt new file mode 100644 index 0000000..82b9e73 --- /dev/null +++ b/10 - Inventory/2.txt @@ -0,0 +1,7 @@ +3 +6 +0 1 0 1 0 1 +4 +0 1 0 1 +2 +0 1 \ No newline at end of file diff --git a/10 - Inventory/3.txt b/10 - Inventory/3.txt new file mode 100644 index 0000000..a18055c --- /dev/null +++ b/10 - Inventory/3.txt @@ -0,0 +1,9 @@ +8 +10 +76 +1 +695 +0 +43 +24 +103 \ No newline at end of file diff --git a/10 - Inventory/4.txt b/10 - Inventory/4.txt new file mode 100644 index 0000000..c7018f1 --- /dev/null +++ b/10 - Inventory/4.txt @@ -0,0 +1,9 @@ +4 +1 +1 +1 +2 +1 +3 +1 +4 \ No newline at end of file diff --git a/10 - Inventory/5.txt b/10 - Inventory/5.txt new file mode 100644 index 0000000..bc950cc --- /dev/null +++ b/10 - Inventory/5.txt @@ -0,0 +1,19 @@ +9 +1 +1 +2 +2 2 +3 +3 3 3 +4 +4 4 4 4 +5 +5 5 5 5 5 +6 +6 6 6 6 6 6 +7 +7 7 7 7 7 7 7 +8 +8 8 8 8 8 8 8 8 +9 +9 9 9 9 9 9 9 9 9 \ No newline at end of file diff --git a/10 - Inventory/6.txt b/10 - Inventory/6.txt new file mode 100644 index 0000000..037b027 --- /dev/null +++ b/10 - Inventory/6.txt @@ -0,0 +1,11 @@ +5 +4 +0 0 0 0 +3 +0 0 0 +8 +0 0 0 0 0 0 0 0 +2 +0 0 +7 +0 0 0 0 0 0 0 \ No newline at end of file diff --git a/10 - Inventory/7.txt b/10 - Inventory/7.txt new file mode 100644 index 0000000..8866aab --- /dev/null +++ b/10 - Inventory/7.txt @@ -0,0 +1,11 @@ +5 +4 +123 530 257 126 +3 +1203 123 630 +1 +2863 +4 +803 217 48 102 +2 +1092 1086 \ No newline at end of file diff --git a/10 - Inventory/8.txt b/10 - Inventory/8.txt new file mode 100644 index 0000000..3eeb4c7 --- /dev/null +++ b/10 - Inventory/8.txt @@ -0,0 +1,21 @@ +10 +3 +23478 13489 46089 +6 +2 479 1234 8304 691 4689 +6 +124 302 48 47821 231 40 +3 +946 79 1023 +6 +583 1439 63091 41834 249 1230 +7 +109 20 5389 1 56309 138 1029 +6 +111 12039 15 297 1239 629 +5 +7 198 12489 2 29842 +7 +849 2347 812 459 1891 85924 4 +8 +14389 248 23178 398 48 198 8 1328 \ No newline at end of file diff --git a/10 - Inventory/9.txt b/10 - Inventory/9.txt new file mode 100644 index 0000000..91d2bbb --- /dev/null +++ b/10 - Inventory/9.txt @@ -0,0 +1,101 @@ +50 +14 +17010 2560 10500 15300 20916 918 0 11696 12425 66 0 21840 3672 8176 +4 +14400 265 0 924 +14 +150 22707 25440 2205 304 8740 8288 0 7656 0 49914 7503 6930 8811 +15 +12834 8000 10206 5076 14973 16008 6174 4095 58374 0 2640 65856 3066 32725 1360 +10 +41850 26048 47763 4656 33930 1200 648 12740 8556 7260 +13 +702 11844 40194 2881 1768 15106 12879 12740 6440 0 3795 234 576 +6 +11200 43512 4370 2765 0 6498 +10 +6840 9516 19845 570 5724 15168 540 10800 16744 17019 +4 +544 30104 378 1512 +12 +9408 10512 3267 6636 27930 36720 0 10290 1880 6534 0 6888 +13 +4056 67221 25935 12792 0 2408 195 13320 24650 81 2700 2112 49842 +6 +28658 24255 2660 8550 56960 34365 +18 +2376 5304 44640 38412 840 1536 1953 30336 24320 27666 30784 35696 8772 15281 4650 4290 756 31584 +19 +3402 19344 5292 51888 48776 8976 6804 10260 2400 6880 6222 0 24735 2610 3744 17640 25480 378 0 +11 +11970 0 4080 1501 1056 21060 504 0 3234 24424 2548 +5 +2800 3318 29376 234 8924 +20 +0 0 15066 6660 0 8000 1540 11696 36656 4620 25220 0 4620 0 549 5000 4316 2300 9078 5624 +7 +6210 1440 30184 28880 0 33872 5400 +9 +5280 792 3666 7584 736 29106 23954 532 5670 +17 +368 820 63798 11396 5152 6450 1470 12320 21627 6768 10044 2700 1278 11562 28576 3268 918 +8 +0 7350 20720 20776 6052 63063 1280 4171 +3 +31850 12025 1032 +1 +0 +9 +32472 3660 4977 15750 2184 2052 2268 3198 45493 +5 +980 3552 8715 36036 42840 +1 +20805 +7 +5251 3591 8690 6384 0 24960 22272 +11 +23940 0 2975 8910 8730 32928 3350 3478 18048 2772 8400 +13 +44992 26130 15040 10560 4240 15120 28560 22265 344 36864 5544 3185 13056 +8 +7564 8176 2680 13536 3060 17199 10656 3456 +8 +2184 18270 42742 320 4500 7056 2964 0 +13 +11562 25344 8316 0 0 180 4482 15708 19095 7600 0 1080 1260 +2 +5046 24444 +4 +27224 5148 3600 35105 +15 +1800 35046 1386 23296 1104 44688 0 2592 3276 18865 10004 765 14259 0 3348 +20 +0 5040 2125 9576 12312 666 36 11703 357 7000 17472 0 0 4752 0 0 9360 15930 9568 328 +16 +6600 6600 1995 2788 1898 14952 6417 996 7735 1365 0 5832 1020 27840 1620 7680 +14 +21888 1188 180 1404 60368 13728 5481 0 10370 17920 39494 9300 0 0 +15 +31488 3036 4256 2688 330 15750 756 15400 19251 2565 6555 1248 627 2600 1218 +1 +0 +19 +0 24696 8640 4176 4160 0 0 11284 27072 14168 2150 6696 16268 576 1134 1160 0 18432 0 +10 +11792 9126 14336 7298 59808 29370 474 2349 2784 3472 +3 +616 2244 3920 +3 +6080 3337 16848 +4 +4218 15876 17460 14664 +9 +16320 35280 12320 0 0 12690 0 12528 3888 +15 +1620 28032 5075 10492 26166 17200 114 1080 6936 24864 14208 6142 600 40500 12160 +10 +21840 30976 36352 4720 7722 25850 21168 20400 22176 850 +17 +23700 16544 6278 2565 6750 7520 1050 0 168 1680 5400 0 3720 5040 3612 4920 20790 +20 +1188 280 0 7154 4416 445 924 4752 40592 0 19035 10368 4860 2905 12090 11172 2926 16856 24682 27738 \ No newline at end of file diff --git a/10 - Inventory/main.py b/10 - Inventory/main.py new file mode 100644 index 0000000..98f1453 --- /dev/null +++ b/10 - Inventory/main.py @@ -0,0 +1,19 @@ +import sys + +tables = sys.stdin.readline() +total = 0 #the total sum +sums = [] #the sum of each table + +for i in range(int(tables)): + boxes = sys.stdin.readline() + masks = 0 #the number of masks on this table + + for j in sys.stdin.readline().split(): #iterates over every number on the line + masks += int(j) + + total += masks #adds to the total + sums.append(masks) #and stores the amount on this table + +print(total) +for i in sums: #print every sum + print(i) \ No newline at end of file diff --git a/11 - Branding/0.txt b/11 - Branding/0.txt new file mode 100644 index 0000000..b279506 --- /dev/null +++ b/11 - Branding/0.txt @@ -0,0 +1,5 @@ +Freddy’s Masks +3 +Frank’s Meats +George’s Masks +Flower Market \ No newline at end of file diff --git a/11 - Branding/1.txt b/11 - Branding/1.txt new file mode 100644 index 0000000..9d24a06 --- /dev/null +++ b/11 - Branding/1.txt @@ -0,0 +1,6 @@ +Quackers’ +4 +Quaker +Quick Food +All-Quality +QoQo’s \ No newline at end of file diff --git a/11 - Branding/2.txt b/11 - Branding/2.txt new file mode 100644 index 0000000..523758f --- /dev/null +++ b/11 - Branding/2.txt @@ -0,0 +1,3 @@ +Duck Tape +1 +DUCK TAPE \ No newline at end of file diff --git a/11 - Branding/3.txt b/11 - Branding/3.txt new file mode 100644 index 0000000..8bd0019 --- /dev/null +++ b/11 - Branding/3.txt @@ -0,0 +1,7 @@ +Freddy’s Delivery Service +5 +Frank’s Deli Store +George’s Delivery Service +Filbert’s Department Store +Flowers, Dirt, Soil +Funny and Dumb Stuff \ No newline at end of file diff --git a/11 - Branding/4.txt b/11 - Branding/4.txt new file mode 100644 index 0000000..bba4810 --- /dev/null +++ b/11 - Branding/4.txt @@ -0,0 +1,4 @@ +Freddy’s No-Contact Delivery +2 +Felix’s No-Coronavirus Delivery +Finn’s No-COVID Delivery \ No newline at end of file diff --git a/11 - Branding/5.txt b/11 - Branding/5.txt new file mode 100644 index 0000000..7975886 --- /dev/null +++ b/11 - Branding/5.txt @@ -0,0 +1,12 @@ +Freddy and Friends +10 +FA +FB +FC +FD +FE +FF +FG +FH +FI +FJ \ No newline at end of file diff --git a/11 - Branding/6.txt b/11 - Branding/6.txt new file mode 100644 index 0000000..7d667de --- /dev/null +++ b/11 - Branding/6.txt @@ -0,0 +1,12 @@ +Freddy is Number 1 +10 +Facetiousnesses Nanocrystalline +Familiarization Nationalization +Fantasticalness Naturalizations +Fashionableness Nearsightedness +Featherstitched Necessitousness +Featherstitches Necromantically +Federalizations Negligibilities +Fetishistically Negotiabilities +Fibrinopeptides Neocolonialisms +Fictionizations Neocolonialists \ No newline at end of file diff --git a/11 - Branding/7.txt b/11 - Branding/7.txt new file mode 100644 index 0000000..4920a13 --- /dev/null +++ b/11 - Branding/7.txt @@ -0,0 +1,60 @@ +Freddy Hacks +58 +Forest Howe +Freida Waters +Felipe Bird +Fernando Thomas +Francesca Armstrong +Fermin Hendricks +Fannie Skinner +Fanny Graves +Felicia Klein +Frieda Tyler +Freddie Wilson +Francisca Huff +Fredric Miranda +Frances Strong +Frederick Figueroa +Ferdinand Horton +Fredrick Hickman +Florentino Gamble +Fausto Rice +Forrest Poole +Filiberto Tapia +Francine Cardenas +Felecia Melendez +Faye Mccarthy +Frank Hawkins +Floyd Wheeler +Flossie Middleton +Felix Hull +Frankie Sheppard +Fran Conner +Foster Hebert +Florence Levy +Fay Lane +Freeman Hines +Fletcher Everett +Francis Hall +Franklin Phelps +Felton Mills +Francesco Bender +Franklyn Blevins +Frances Dickson +Faith Morris +Francisco Keller +Fabian Wilkinson +Fern Lowe +Frederic Reeves +Frankie Ayers +Federico Gibbs +Flora Dodson +Florine Nelson +Freddy Daniels +Fred Kaufman +Fritz Ritter +Fidel Cordova +Freda Moore +Francis Roy +Florencio Lucas +Faustino Schroeder \ No newline at end of file diff --git a/11 - Branding/8.txt b/11 - Branding/8.txt new file mode 100644 index 0000000..a43c59c --- /dev/null +++ b/11 - Branding/8.txt @@ -0,0 +1,102 @@ +rqFreddyxloeTeqpu +100 +ncEcbnhlakFreddyz +nFreddyvpDatomsyz +qikqbqXyFreddywsa +gjFreddydXyvqgobp +auFreddyxpZxfsfid +xsotWsgwluFreddyq +eirTkiFreddymocpj +ztKvFreddyelhclrf +FFreddyhfywmueear +FreddycleiOdrccbf +ufpewwVaqsFreddyk +cuePxFreddyiqzhad +nksuFreddyysopzTk +qzsFreddytqWghybe +atosrFreddyxfPzix +kitrGtFreddyupsmo +jhkuikNjeFreddymj +ieoaHnbFreddycryb +myyylMFreddyvolfe +iCFreddytapbjkjkb +kcFreddymngxJqbul +FreddyjZiqbymmxpc +rFreddyQvogrnjyjl +ypmVgtlvmFreddyjm +cznhgFreddyZlvzzv +qVmkzFreddyoqgdug +bklkyuvFreddygoVy +ZvFreddythtvrrmpw +onutlNavxlFreddyj +FreddympvLoctettc +FreddySmhlqfgsacr +cCkudqxFreddyjbye +rJuFreddynhyfvtfm +gnbMnrFreddytolsj +qtykFreddyjrHcalu +FreddywzeqxgxRzem +xKtFreddyjlnvptsg +gbFreddytjaxqFixj +npjvFreddymwZielf +FreddyigczuhBzbbz +FreddyiVjbkronfil +dlowjmemFreddyNcz +vhFreddyhcznNfydv +cbCdFreddycavlbdo +xhFreddyizqvapLdi +njfyweFreddygpClr +VecaFreddywzcoxrm +iFreddyjnhtwmbmDy +pqfzixslFreddySex +yFreddyeeAogpmaeo +FreddyphlldrhErsc +FreddyrosmGzvaohc +AbkclFreddytoynri +ymcnMvFreddypwfel +hxxbrgkFreddyiMjl +qwnoNupaFreddyepj +odydrurFphFreddyi +RFreddyhpjyycfuhr +vbmgFreddymImcjdr +fpgsSnFreddyunjxr +dnFreddyIrwrtwoia +vXyqamfuhcFreddyw +mrjdIvgidnFreddyj +fFreddyaqTjrtplme +TuFreddyyazahnhuh +QetFreddydumtvomn +brclwbZfvjFreddyy +bcmohlFreddyUrobv +naFreddykxvzHabss +FreddycwdxCurrycw +jGiFreddyuwsgdcwv +yiYqescsiFreddyfs +qyflrKkdlkFreddyh +ErxFreddydsyygfed +zfiweeenOFreddysy +FreddygqmjipfePaj +txpzgpntpZFreddya +FodFreddypbeqqiny +FreddybmovlcDdkne +lphumPqwqlFreddyb +vQdjFreddyhrpfpgz +xgtwzwlFreddyHkmo +gegqsmjfFreddyuXx +horvyyFreddyqOrqu +oltuhiFreddyAygdv +yhtydZltyFreddyxv +dpgdekoFmFreddyfe +aigGgFreddyhsjrov +vFreddyJxnuohecsd +gnGekesvzpFreddyt +zvwKFreddylirvvvt +XhbmwseFreddybqir +gFreddycAitarzzsn +dtLknFreddyugzhsm +tvyygXFreddyetjon +xtbeYkegdvFreddyk +FreddymmaeBkdpged +gTdhskiFreddydgjb +fFhyeatFreddyqivb +lajFreddytnEnrpgp \ No newline at end of file diff --git a/11 - Branding/9.txt b/11 - Branding/9.txt new file mode 100644 index 0000000..3054422 --- /dev/null +++ b/11 - Branding/9.txt @@ -0,0 +1,102 @@ +TJpaleeFreddyQBLe +100 +zUnYrFreddymSiPHa +rHLYffFreddyPhEha +qEbMNwFreddywfWBb +WWFreddycFsFyyXwa +YQeOAyauiSFreddyb +wvVvcFreddyIWRxHq +vPSFreddypBaOoHni +kFyDwFreddyZdrWSy +FreddyvSwFNuBhzSt +huwDchFreddyRBYBc +pQEaBmSWxqFreddyd +jvBpFPxFFreddyJle +ivFreddymDWgxCTTn +YSfHugFreddytJByq +tCZLjxtFreddyWlZa +OgSFreddyIdtPEwkb +rbZFreddymLKIepIf +YjhWaEFreddyrFCfa +QokKigVLHmFreddyk +XohFreddyZdGOxzUa +bXsDfRgNMFreddyfl +YOskUIAFreddygtto +NhgWGFreddycDvGzr +jrzGTFreddyeMgNIy +vFreddyEmwzYLpHTp +yoRKuoFreddyLhRYy +fBGkgHIWFreddytyl +BYXlLFreddyWbocwq +LmGFreddydogCEmAz +YeFiYameFFreddyDc +FreddyicVAIFnRefw +WuhFreddyVBQqeHyh +JFreddydzsZjvFABm +vCmPwLcVOoFreddyu +pDhmKzXAZnFreddyl +FreddyxjPbVriELKp +qCqGFreddyPcXjNef +PIVcBFreddyyHmhds +zjFreddyzcOSlANMg +gaFreddyVSBIJjdgm +KrFreddyPcklKtQWy +iLuyjoNCMKFreddyw +uCAWymlYBFreddysi +vNrFreddyeGOmqSGk +mEdNeFMkkZFreddyz +ivpVMBKLkiFreddyp +QFreddywMxDhVluVc +uoqqUjDBPFreddyJc +HIFreddyDEzcaOyxb +eyFreddyQDXpOheXk +iXfRcjGFreddyBrDy +AhPjalCUuFreddyKf +NILhFreddyjjwMlGp +CwFreddyfQOFgcoGp +kDwyEYHmZdFreddyp +LlcyKkQFreddyKcVj +zcgxCQVuFreddyYOm +syWYVAFreddyxuTyv +faBVOHiAFreddymub +RHVywheFreddyFSyo +QOFreddyYFfPtfzja +GfsAFreddyWorjNJr +UwTAwkFreddywhBRo +TTcgvFreddyXsGcBj +waZFreddytVWCkAst +qFreddyZrrFMIDmou +BvHWynFreddynNZhu +yDjAdBZQdpFreddyx +wULvWrFreddyJiZxt +bdSoBqNFreddyOsZg +EnFreddyRqslCyGNj +ECcgHFreddyYcwJvt +rFreddyOaQfPNrkFk +NFreddykzWaWJipAn +TuFreddyoSwrNEyFb +gcSLGfFreddyUCuyb +nxyLViFreddyTVUlp +bovzFreddyDZMiYEl +NLeSLFreddyooeOcx +XzQFreddyxxmFsYNj +BbwDFreddymcDgAIn +FreddySxedzGlUVNq +ajJaEGpQiFreddyTu +xlFreddyWHwRnYWjr +LzsUnsFreddyHsUEl +cUBoQFreddygJAmaa +qrmGYVgFreddyKeOb +FreddyGuNcgXPIqnc +FEFreddypAtbkAuPh +qYubMFreddyZUufJm +ZMQeoOHbzFreddylv +MBcKQmnLwFreddyht +tRadAIaZvFreddyLh +cNVGOnwjBrFreddyb +ZHFreddyMstTdmScz +HskZRFreddyhQfyAa +jNcEajjDFreddyPNd +FreddyxQonOIOryJf +zYNFreddyWBdgkTwg +nyTzmGQFreddyNzJf \ No newline at end of file diff --git a/11 - Branding/main.py b/11 - Branding/main.py new file mode 100644 index 0000000..1a3cfcb --- /dev/null +++ b/11 - Branding/main.py @@ -0,0 +1,25 @@ +import sys + +#turns a string into its initials +def get_initials(string): + output = '' + for i in string: #iterates over the characters in the string + if i.isupper(): #adds the letter if it's uppercase + output += i + return output + +initials = get_initials(sys.stdin.readline()) +names = sys.stdin.readline() +conflicts = [] #the list of conflicts + +for i in range(int(names)): + name = sys.stdin.readline() + if get_initials(name) == initials: #checks for conflicts + conflicts.append(name) + +if not conflicts: #if there are no conflicts + conflicts.append('NONE') + +#.join() lets you quickly print a list with the given separator +#all the names already have newlines at the end so we need no separator +print(''.join(conflicts)) \ No newline at end of file diff --git a/12 - Delivery Duplication/0.txt b/12 - Delivery Duplication/0.txt new file mode 100644 index 0000000..4b9e1f7 --- /dev/null +++ b/12 - Delivery Duplication/0.txt @@ -0,0 +1,10 @@ +3 +100 Duck Lane +200 Goose Street +300 Swan Drive +5 +100 Duck Lane +101 Dog Road +201 Cat Boulevard +300 Swan Drive +301 Mouse Way \ No newline at end of file diff --git a/12 - Delivery Duplication/1.txt b/12 - Delivery Duplication/1.txt new file mode 100644 index 0000000..a1ef2f2 --- /dev/null +++ b/12 - Delivery Duplication/1.txt @@ -0,0 +1,6 @@ +2 +32A +45B +2 +45B +32A \ No newline at end of file diff --git a/12 - Delivery Duplication/2.txt b/12 - Delivery Duplication/2.txt new file mode 100644 index 0000000..fdca875 --- /dev/null +++ b/12 - Delivery Duplication/2.txt @@ -0,0 +1,4 @@ +1 +Address #1 +1 +Address #2 \ No newline at end of file diff --git a/12 - Delivery Duplication/3.txt b/12 - Delivery Duplication/3.txt new file mode 100644 index 0000000..c9e7b0c --- /dev/null +++ b/12 - Delivery Duplication/3.txt @@ -0,0 +1,28 @@ +13 +A +B +C +D +E +F +G +H +I +J +K +L +M +13 +N +O +P +Q +R +S +T +U +V +W +X +Y +Z \ No newline at end of file diff --git a/12 - Delivery Duplication/4.txt b/12 - Delivery Duplication/4.txt new file mode 100644 index 0000000..1c697d1 --- /dev/null +++ b/12 - Delivery Duplication/4.txt @@ -0,0 +1,20 @@ +9 +A 1 +B 1 +C 1 +A 2 +B 2 +C 2 +A 3 +B 3 +C 3 +9 +A 1 +A 2 +A 3 +B 1 +B 2 +B 3 +C 1 +C 2 +C 3 \ No newline at end of file diff --git a/12 - Delivery Duplication/5.txt b/12 - Delivery Duplication/5.txt new file mode 100644 index 0000000..4a6741f --- /dev/null +++ b/12 - Delivery Duplication/5.txt @@ -0,0 +1,46 @@ +5 +road +street +boulevard +avenue +parkway +39 +artery +avenue +boulevard +course +drive +expressway +highway +lane +line +parking lot +pathway +pavement +roadway +route +street +subway +thoroughfare +track +trail +way +alley +asphalt +byway +cobblestone +concrete +crossroad +direction +drag +parkway +passage +pike +terrace +throughway +thruway +turnpike +viaduct +back street +dragway +main drag \ No newline at end of file diff --git a/12 - Delivery Duplication/6.txt b/12 - Delivery Duplication/6.txt new file mode 100644 index 0000000..40f7e7a --- /dev/null +++ b/12 - Delivery Duplication/6.txt @@ -0,0 +1,46 @@ +39 +artery +avenue +boulevard +course +drive +expressway +highway +lane +line +parking lot +pathway +pavement +roadway +route +street +subway +thoroughfare +track +trail +way +alley +asphalt +byway +cobblestone +concrete +crossroad +direction +drag +parkway +passage +pike +terrace +throughway +thruway +turnpike +viaduct +back street +dragway +main drag +5 +road +street +boulevard +avenue +parkway \ No newline at end of file diff --git a/12 - Delivery Duplication/7.txt b/12 - Delivery Duplication/7.txt new file mode 100644 index 0000000..36c54f2 --- /dev/null +++ b/12 - Delivery Duplication/7.txt @@ -0,0 +1,72 @@ +35 +lorem +ipsum +dolor +sit +amet +consectetur +adipiscing +elit +sed +do +eiusmod +tempor +incididunt +ut +labore +et +dolore +magna +aliqua +ut +enim +ad +minim +veniam +quis +nostrud +exercitation +ullamco +laboris +nisi +ut +aliquip +ex +ea +commodo +35 +consequat +duis +aute +irure +dolor +in +reprehenderit +in +voluptate +velit +esse +cillum +dolore +eu +fugiat +nulla +pariatur +Excepteur +sint +occaecat +cupidatat +non +proident +sunt +in +culpa +qui +officia +deserunt +mollit +anim +id +est +laborum +freddy \ No newline at end of file diff --git a/12 - Delivery Duplication/8.txt b/12 - Delivery Duplication/8.txt new file mode 100644 index 0000000..5994011 --- /dev/null +++ b/12 - Delivery Duplication/8.txt @@ -0,0 +1,16 @@ +8 +4 +21 +6 +2 +7 +17 +11 +5 +6 +8 +12 +16 +1 +22 +18 \ No newline at end of file diff --git a/12 - Delivery Duplication/9.txt b/12 - Delivery Duplication/9.txt new file mode 100644 index 0000000..d7e1a13 --- /dev/null +++ b/12 - Delivery Duplication/9.txt @@ -0,0 +1,202 @@ +100 +GA +qP +s4 +Q8 +bi +34 +Zr +4i +pi +rb +LH +fZ +uR +YG +qV +UO +pF +hF +Ak +YH +IF +0R +Lm +1S +G5 +w2 +hT +ZF +BD +4Y +Tp +52 +Zn +r7 +Ft +MS +7e +wM +zY +rh +BJ +B0 +6c +7C +XQ +hp +8B +Ai +4U +Yu +vu +B1 +xN +b2 +2A +NB +RP +gY +xZ +gC +ag +E5 +nM +Ov +3d +C9 +aA +w1 +Nw +8k +ZI +NX +qc +x8 +Rr +eP +PO +5N +Os +d2 +6X +c3 +vH +W5 +D1 +QL +pk +Sj +wT +m2 +gr +9O +OA +zp +B3 +ue +4L +Xb +Rb +R8 +100 +4m +xq +E3 +h1 +0H +lq +dj +OR +PY +TR +vS +sO +Jp +Sk +Z0 +Qk +6K +wg +2j +G3 +LX +Xi +A5 +7i +To +yb +V1 +Dj +G5 +cR +2w +NV +hT +RB +a5 +ZF +dx +e4 +rE +1H +Wq +Wn +C5 +e9 +0D +Xr +hy +1K +nh +i7 +O1 +ti +74 +5r +pX +Mi +oZ +Jn +s7 +ei +5f +jG +Qx +8X +oU +GI +wO +ZN +pr +at +pT +ur +XA +6i +Ru +E6 +Y0 +Dk +ly +nl +cv +th +Rp +AN +XU +M0 +0g +yH +lz +Rw +Nt +LG +jf +QF +Ao +Vy +K0 +EW +45 +Nf \ No newline at end of file diff --git a/12 - Delivery Duplication/main.py b/12 - Delivery Duplication/main.py new file mode 100644 index 0000000..8195d5f --- /dev/null +++ b/12 - Delivery Duplication/main.py @@ -0,0 +1,21 @@ +import sys + +length = sys.stdin.readline() +old = [] #the addresses from last week +for i in range(int(length)): + old.append(sys.stdin.readline()) + +length = sys.stdin.readline() +new = [] #the addresses from this week +for i in range(int(length)): + new.append(sys.stdin.readline()) + +duplicates = [] #the duplicate addresses +for i in old: #loops over the old address list + if i in new: #and checks if they're in the new list + duplicates.append(i) #if so, they're duplicated + +if not duplicates: #if there are no duplicates + duplicates.append('NONE') + +print(''.join(duplicates)) diff --git a/13- Manhattan Delivery/0.txt b/13- Manhattan Delivery/0.txt new file mode 100644 index 0000000..f7f9a0a --- /dev/null +++ b/13- Manhattan Delivery/0.txt @@ -0,0 +1,6 @@ +0 0 +4 +1 1 +2 3 +5 2 +0 4 \ No newline at end of file diff --git a/13- Manhattan Delivery/1.txt b/13- Manhattan Delivery/1.txt new file mode 100644 index 0000000..f10586f --- /dev/null +++ b/13- Manhattan Delivery/1.txt @@ -0,0 +1,5 @@ +2 1 +3 +2 1 +2 2 +2 3 \ No newline at end of file diff --git a/13- Manhattan Delivery/2.txt b/13- Manhattan Delivery/2.txt new file mode 100644 index 0000000..a8a4757 --- /dev/null +++ b/13- Manhattan Delivery/2.txt @@ -0,0 +1,6 @@ +1 1 +4 +1 0 +0 1 +-1 0 +0 -1 \ No newline at end of file diff --git a/13- Manhattan Delivery/3.txt b/13- Manhattan Delivery/3.txt new file mode 100644 index 0000000..3156ba1 --- /dev/null +++ b/13- Manhattan Delivery/3.txt @@ -0,0 +1,8 @@ +-10 -10 +6 +-20 -20 +-10 -10 +0 0 +10 10 +20 20 +30 30 \ No newline at end of file diff --git a/13- Manhattan Delivery/4.txt b/13- Manhattan Delivery/4.txt new file mode 100644 index 0000000..0311092 --- /dev/null +++ b/13- Manhattan Delivery/4.txt @@ -0,0 +1,10 @@ +8 7 +8 +-1 6 +2 5 +1 0 +10 6 +7 10 +-10 5 +-5 -2 +1 6 \ No newline at end of file diff --git a/13- Manhattan Delivery/5.txt b/13- Manhattan Delivery/5.txt new file mode 100644 index 0000000..abd85b2 --- /dev/null +++ b/13- Manhattan Delivery/5.txt @@ -0,0 +1,27 @@ +0 0 +25 +0 0 +0 1 +1 1 +1 0 +1 -1 +0 -1 +-1 -1 +-1 0 +-1 1 +-1 2 +0 2 +1 2 +2 2 +2 1 +2 0 +2 -1 +2 -2 +1 -2 +0 -2 +-1 -2 +-2 -2 +-2 -1 +-2 0 +-2 1 +-2 2 \ No newline at end of file diff --git a/13- Manhattan Delivery/6.txt b/13- Manhattan Delivery/6.txt new file mode 100644 index 0000000..ce5a437 --- /dev/null +++ b/13- Manhattan Delivery/6.txt @@ -0,0 +1,12 @@ +5 5 +10 +5 5 +5 5 +5 5 +5 5 +5 5 +-5 -5 +-5 5 +5 -5 +5 5 +5 5 \ No newline at end of file diff --git a/13- Manhattan Delivery/7.txt b/13- Manhattan Delivery/7.txt new file mode 100644 index 0000000..b1ca9cb --- /dev/null +++ b/13- Manhattan Delivery/7.txt @@ -0,0 +1,27 @@ +-44 98 +25 +-91 -30 +84 -86 +4 -97 +-50 -32 +-9 -68 +-29 50 +84 57 +28 36 +-47 89 +33 -66 +-71 31 +-53 -85 +-53 19 +-37 -41 +-63 84 +-72 -17 +82 -61 +57 -98 +-46 17 +-35 -35 +27 -92 +59 -36 +-17 10 +86 -46 +-41 61 \ No newline at end of file diff --git a/13- Manhattan Delivery/8.txt b/13- Manhattan Delivery/8.txt new file mode 100644 index 0000000..ba29404 --- /dev/null +++ b/13- Manhattan Delivery/8.txt @@ -0,0 +1,52 @@ +0 0 +50 +18 270 +-60 -504 +-54 -63 +-108 90 +-54 -560 +0 90 +-300 0 +0 -540 +160 0 +168 0 +0 -60 +175 0 +60 -70 +-324 -84 +72 -120 +-126 7 +-8 108 +-300 -200 +-125 27 +-15 -400 +0 0 +63 72 +60 49 +-90 -378 +18 -64 +270 12 +0 -3 +-18 72 +-560 -189 +18 -9 +0 200 +24 245 +-240 216 +300 108 +-16 -20 +20 -25 +-48 -216 +-54 -405 +96 360 +54 -240 +-140 0 +40 600 +-108 540 +0 -600 +-140 40 +240 -108 +0 -432 +28 -225 +800 0 +9 5 \ No newline at end of file diff --git a/13- Manhattan Delivery/9.txt b/13- Manhattan Delivery/9.txt new file mode 100644 index 0000000..e3c6a32 --- /dev/null +++ b/13- Manhattan Delivery/9.txt @@ -0,0 +1,102 @@ +96 18 +100 +-7594 -2685 +-2965 -6790 +6249 8343 +-3089 -5409 +-2656 1128 +4209 3068 +7509 -8769 +-6980 7036 +-2005 -4388 +-4613 462 +6375 1523 +3446 -8131 +2773 62 +-2024 -9324 +-8424 -449 +-5138 3598 +820 -2193 +-8325 5621 +162 -1745 +-614 -249 +7878 -6100 +6659 -6732 +-4998 5989 +-3835 -109 +-7271 4482 +-6559 -9692 +353 2691 +-5156 3902 +-4940 -3876 +6795 -3156 +-8049 -5620 +1850 -8832 +1227 -6579 +-1214 4235 +5581 799 +-3219 3492 +-4651 -4108 +5504 9948 +5020 8368 +-2300 7500 +1895 -2342 +-1659 9197 +2338 4166 +-1863 -3209 +-3048 25 +5684 -3839 +-6006 2082 +5604 -3189 +5302 -8805 +200 -5574 +7429 8421 +5054 -1063 +1563 -9407 +4423 -4841 +-8908 4493 +-6304 676 +-7893 2348 +3030 2061 +-6266 -5489 +5211 3682 +8211 -8247 +9120 -7869 +-112 -4584 +5052 276 +3427 2904 +9055 -4515 +-4988 3847 +-8822 -1976 +8853 -6236 +-9017 -2711 +-5131 -987 +-6621 -6866 +725 7200 +-3026 -5622 +-2719 3824 +-2270 4197 +-7897 8049 +7603 -6533 +2288 -2226 +8140 57 +-4489 -5025 +5827 6637 +7458 3943 +4482 7258 +-2150 -4326 +7226 -7340 +6021 -2529 +-8034 -8541 +-9004 -531 +3322 1958 +-8011 4945 +-2498 7508 +-5382 2097 +-8409 -2327 +2926 340 +6142 -6480 +-3414 -3997 +-1309 -1101 +5818 -1010 +6641 7869 \ No newline at end of file diff --git a/13- Manhattan Delivery/main.py b/13- Manhattan Delivery/main.py new file mode 100644 index 0000000..9235854 --- /dev/null +++ b/13- Manhattan Delivery/main.py @@ -0,0 +1,10 @@ +import sys + +freddy_x, freddy_y = sys.stdin.readline().split() +addresses = sys.stdin.readline() + +for i in range(int(addresses)): + x, y = sys.stdin.readline().split() + diff_x = abs(int(freddy_x) - int(x)) #number of horizontal blocks + diff_y = abs(int(freddy_y) - int(y)) #number of vertical blocks + print(diff_x + diff_y) #manhattan distance = difference in x + difference in y \ No newline at end of file diff --git a/14 - Social Distancing/0.txt b/14 - Social Distancing/0.txt new file mode 100644 index 0000000..8295fb7 --- /dev/null +++ b/14 - Social Distancing/0.txt @@ -0,0 +1,5 @@ +4 +0 0 +3 4 +8 4 +3 9 \ No newline at end of file diff --git a/14 - Social Distancing/1.txt b/14 - Social Distancing/1.txt new file mode 100644 index 0000000..c5921f8 --- /dev/null +++ b/14 - Social Distancing/1.txt @@ -0,0 +1,4 @@ +3 +1 1 +-10 0 +5 -4 \ No newline at end of file diff --git a/14 - Social Distancing/2.txt b/14 - Social Distancing/2.txt new file mode 100644 index 0000000..ab1bab4 --- /dev/null +++ b/14 - Social Distancing/2.txt @@ -0,0 +1,4 @@ +3 +0 6 +0 0 +6 0 \ No newline at end of file diff --git a/14 - Social Distancing/3.txt b/14 - Social Distancing/3.txt new file mode 100644 index 0000000..3156ba1 --- /dev/null +++ b/14 - Social Distancing/3.txt @@ -0,0 +1,8 @@ +-10 -10 +6 +-20 -20 +-10 -10 +0 0 +10 10 +20 20 +30 30 \ No newline at end of file diff --git a/14 - Social Distancing/4.txt b/14 - Social Distancing/4.txt new file mode 100644 index 0000000..2c02e8f --- /dev/null +++ b/14 - Social Distancing/4.txt @@ -0,0 +1,7 @@ +6 +0 10 +10 10 +10 0 +0 -10 +-10 -10 +-10 0 \ No newline at end of file diff --git a/14 - Social Distancing/5.txt b/14 - Social Distancing/5.txt new file mode 100644 index 0000000..ec2ad82 --- /dev/null +++ b/14 - Social Distancing/5.txt @@ -0,0 +1,5 @@ +4 +0 0 +10 10 +3 4 +6 0 \ No newline at end of file diff --git a/14 - Social Distancing/6.txt b/14 - Social Distancing/6.txt new file mode 100644 index 0000000..1606117 --- /dev/null +++ b/14 - Social Distancing/6.txt @@ -0,0 +1,7 @@ +6 +0 0 +0 0 +1 1 +10 10 +100 100 +1000 1000 \ No newline at end of file diff --git a/14 - Social Distancing/7.txt b/14 - Social Distancing/7.txt new file mode 100644 index 0000000..648f4e3 --- /dev/null +++ b/14 - Social Distancing/7.txt @@ -0,0 +1,21 @@ +20 +0 0 +10 10 +-10 4 +18 3 +-19 4 +-20 -5 +-8 9 +13 -5 +8 19 +-9 -25 +7 -30 +40 21 +-21 20 +-30 -10 +31 -39 +-40 -42 +-5 61 +55 -20 +63 12 +-12 -70 \ No newline at end of file diff --git a/14 - Social Distancing/8.txt b/14 - Social Distancing/8.txt new file mode 100644 index 0000000..99de1b7 --- /dev/null +++ b/14 - Social Distancing/8.txt @@ -0,0 +1,26 @@ +25 +4 -1 +9 -9 +15 -15 +-22 24 +35 -29 +-38 36 +-52 52 +-54 -52 +-61 -67 +68 -75 +83 82 +87 -90 +100 92 +106 100 +109 113 +120 -118 +-124 -127 +-137 -138 +-143 145 +155 -156 +162 -158 +-168 -165 +177 172 +180 -186 +-196 190 \ No newline at end of file diff --git a/14 - Social Distancing/9.txt b/14 - Social Distancing/9.txt new file mode 100644 index 0000000..17f3310 --- /dev/null +++ b/14 - Social Distancing/9.txt @@ -0,0 +1,31 @@ +30 +0 2 +6 -11 +20 16 +24 -26 +-29 30 +38 42 +-45 49 +-59 58 +63 62 +69 73 +-77 -81 +-85 -88 +-99 93 +103 102 +109 -116 +116 -120 +-131 132 +-133 132 +-144 142 +-148 155 +160 156 +-170 -165 +174 175 +180 188 +-195 193 +-197 -198 +204 205 +215 220 +-228 225 +229 231 \ No newline at end of file diff --git a/14 - Social Distancing/main.py b/14 - Social Distancing/main.py new file mode 100644 index 0000000..1dee4a4 --- /dev/null +++ b/14 - Social Distancing/main.py @@ -0,0 +1,19 @@ +import sys + +ducks = sys.stdin.readline() #read the first number +coords = sys.stdin.readlines() #read the rest of the lines +minimum = 1e100 ##set the minimum impossibly high + +#two loops lets us look at every pair of ducks +for i in range(int(ducks)): + for j in range(int(ducks)): + if i != j: #we don't want to compare a duck to itself! + x1, y1 = coords[i].split() + x2, y2 = coords[j].split() + diff_x = abs(int(x1) - int(x2)) #horizontal distance + diff_y = abs(int(y1) - int(y2)) #vertical distance + diff = diff_x * diff_x + diff_y * diff_y #squared distance = squared difference in x + squared difference in y + minimum = min(minimum, diff) #sets minimum to diff if it's lower + +print(minimum) +print('YES' if minimum >= 36 else 'NO') #6 feet is 36 in squared distance \ No newline at end of file diff --git a/15 - Self-quarantine/0.txt b/15 - Self-quarantine/0.txt new file mode 100644 index 0000000..976f0f7 --- /dev/null +++ b/15 - Self-quarantine/0.txt @@ -0,0 +1,5 @@ +January 1 +3 +January 1 +January 14 +January 15 \ No newline at end of file diff --git a/15 - Self-quarantine/1.txt b/15 - Self-quarantine/1.txt new file mode 100644 index 0000000..c5921f8 --- /dev/null +++ b/15 - Self-quarantine/1.txt @@ -0,0 +1,4 @@ +3 +1 1 +-10 0 +5 -4 \ No newline at end of file diff --git a/15 - Self-quarantine/2.txt b/15 - Self-quarantine/2.txt new file mode 100644 index 0000000..53a99f4 --- /dev/null +++ b/15 - Self-quarantine/2.txt @@ -0,0 +1,7 @@ +February 22 +5 +February 28 +February 21 +March 7 +March 7 +March 8 \ No newline at end of file diff --git a/15 - Self-quarantine/3.txt b/15 - Self-quarantine/3.txt new file mode 100644 index 0000000..3156ba1 --- /dev/null +++ b/15 - Self-quarantine/3.txt @@ -0,0 +1,8 @@ +-10 -10 +6 +-20 -20 +-10 -10 +0 0 +10 10 +20 20 +30 30 \ No newline at end of file diff --git a/15 - Self-quarantine/4.txt b/15 - Self-quarantine/4.txt new file mode 100644 index 0000000..00da923 --- /dev/null +++ b/15 - Self-quarantine/4.txt @@ -0,0 +1,4 @@ +December 24 +2 +December 25 +January 1 \ No newline at end of file diff --git a/15 - Self-quarantine/5.txt b/15 - Self-quarantine/5.txt new file mode 100644 index 0000000..8da997f --- /dev/null +++ b/15 - Self-quarantine/5.txt @@ -0,0 +1,20 @@ +August 24 +18 +August 15 +August 16 +August 17 +August 18 +August 19 +August 20 +August 21 +August 22 +August 23 +August 24 +August 25 +August 26 +August 27 +August 28 +August 29 +August 30 +August 31 +September 1 \ No newline at end of file diff --git a/15 - Self-quarantine/6.txt b/15 - Self-quarantine/6.txt new file mode 100644 index 0000000..265a767 --- /dev/null +++ b/15 - Self-quarantine/6.txt @@ -0,0 +1,26 @@ +October 18 +24 +January 1 +February 1 +March 1 +April 1 +May 1 +June 1 +July 1 +August 1 +September 1 +October 1 +November 1 +December 1 +January 31 +February 28 +March 31 +April 30 +May 31 +June 30 +July 31 +August 31 +September 30 +October 31 +November 30 +December 31 \ No newline at end of file diff --git a/15 - Self-quarantine/7.txt b/15 - Self-quarantine/7.txt new file mode 100644 index 0000000..6a0191c --- /dev/null +++ b/15 - Self-quarantine/7.txt @@ -0,0 +1,52 @@ +December 30 +50 +December 9 +May 13 +April 12 +July 1 +January 24 +June 26 +January 9 +October 14 +October 11 +May 24 +January 28 +March 20 +May 2 +August 10 +July 31 +October 17 +April 13 +June 30 +October 31 +December 31 +March 26 +December 12 +July 1 +August 14 +August 1 +February 27 +April 14 +October 11 +October 16 +August 26 +September 29 +July 19 +December 1 +August 7 +April 3 +July 18 +January 1 +July 31 +February 1 +November 18 +November 5 +September 30 +September 21 +December 9 +June 18 +February 20 +May 13 +September 25 +September 9 +September 16 \ No newline at end of file diff --git a/15 - Self-quarantine/8.txt b/15 - Self-quarantine/8.txt new file mode 100644 index 0000000..e80af4a --- /dev/null +++ b/15 - Self-quarantine/8.txt @@ -0,0 +1,77 @@ +July 22 +75 +June 9 +April 18 +October 9 +December 12 +May 3 +August 6 +October 19 +September 11 +August 18 +August 12 +September 15 +February 12 +December 10 +October 29 +June 27 +December 23 +May 1 +March 26 +November 18 +July 5 +August 14 +October 18 +January 8 +April 9 +May 30 +February 23 +May 30 +July 21 +May 21 +March 15 +December 15 +June 9 +April 24 +May 14 +December 16 +October 13 +February 2 +May 4 +August 31 +June 26 +May 19 +July 6 +April 15 +July 9 +January 28 +November 2 +June 9 +April 12 +December 29 +May 30 +November 21 +September 18 +May 24 +April 29 +January 31 +June 7 +November 23 +November 18 +May 31 +June 2 +May 10 +May 9 +October 20 +April 19 +December 13 +December 12 +October 7 +May 29 +February 26 +December 21 +October 16 +April 12 +March 30 +June 6 +November 20 \ No newline at end of file diff --git a/15 - Self-quarantine/9.txt b/15 - Self-quarantine/9.txt new file mode 100644 index 0000000..d002c9c --- /dev/null +++ b/15 - Self-quarantine/9.txt @@ -0,0 +1,102 @@ +December 25 +100 +December 29 +December 29 +January 8 +January 1 +December 9 +January 15 +December 9 +December 16 +January 29 +January 15 +January 16 +December 21 +January 10 +December 7 +January 14 +December 28 +January 13 +December 4 +December 23 +January 25 +December 31 +December 30 +December 26 +January 17 +December 24 +January 4 +December 19 +December 18 +December 13 +December 19 +January 6 +January 30 +January 5 +December 3 +January 13 +January 6 +December 17 +December 29 +December 29 +December 24 +January 3 +January 29 +December 25 +December 20 +December 12 +January 6 +December 16 +January 25 +December 11 +January 6 +December 28 +December 3 +December 30 +January 13 +December 31 +December 9 +January 7 +December 1 +December 27 +December 8 +December 7 +January 18 +January 31 +December 26 +January 13 +January 17 +December 29 +December 2 +January 16 +January 23 +January 30 +January 9 +December 3 +January 30 +January 20 +December 12 +January 2 +December 15 +December 9 +January 16 +December 13 +January 18 +January 9 +January 20 +January 26 +December 29 +January 30 +December 18 +January 26 +January 20 +December 11 +December 17 +December 3 +January 4 +January 8 +December 22 +January 5 +January 10 +December 14 +January 19 \ No newline at end of file diff --git a/15 - Self-quarantine/main.py b/15 - Self-quarantine/main.py new file mode 100644 index 0000000..e45c3b0 --- /dev/null +++ b/15 - Self-quarantine/main.py @@ -0,0 +1,27 @@ +import sys + +#add an extra january to account for the new year +months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', 'January'] +days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31] + +month, day = sys.stdin.readline().split() +month_index = months.index(month) #.index() finds the position in the list +meetings = sys.stdin.readline() +missed = 0 + +for i in range(int(meetings)): + meeting_month, meeting_day = sys.stdin.readline().split() + + #if the dates fall on the same month + if meeting_month == month: + #check if the meeting day is in the next 14-day interval + if int(day) <= int(meeting_day) < int(day) + 14: + missed += 1 + + #if the meeting date is next month + if meeting_month == months[month_index + 1]: + #add all the days of this month before comparing + if int(day) <= days[month_index] + int(meeting_day) < int(day) + 14: + missed += 1 + +print(missed) \ No newline at end of file diff --git a/16 - Lunch Break/0.txt b/16 - Lunch Break/0.txt new file mode 100644 index 0000000..71abe96 --- /dev/null +++ b/16 - Lunch Break/0.txt @@ -0,0 +1,5 @@ +4 +0 60 +90 30 +180 120 +315 15 \ No newline at end of file diff --git a/16 - Lunch Break/1.txt b/16 - Lunch Break/1.txt new file mode 100644 index 0000000..6dc5b81 --- /dev/null +++ b/16 - Lunch Break/1.txt @@ -0,0 +1,4 @@ +3 +120 30 +60 30 +150 30 \ No newline at end of file diff --git a/16 - Lunch Break/2.txt b/16 - Lunch Break/2.txt new file mode 100644 index 0000000..923e639 --- /dev/null +++ b/16 - Lunch Break/2.txt @@ -0,0 +1,5 @@ +4 +10 5 +15 5 +20 5 +25 5 \ No newline at end of file diff --git a/16 - Lunch Break/3.txt b/16 - Lunch Break/3.txt new file mode 100644 index 0000000..eb8f685 --- /dev/null +++ b/16 - Lunch Break/3.txt @@ -0,0 +1,5 @@ +4 +1100 10 +1200 20 +1300 30 +1400 40 \ No newline at end of file diff --git a/16 - Lunch Break/4.txt b/16 - Lunch Break/4.txt new file mode 100644 index 0000000..859d804 --- /dev/null +++ b/16 - Lunch Break/4.txt @@ -0,0 +1,9 @@ +8 +60 39 +99 50 +149 8 +157 20 +177 7 +184 38 +222 55 +277 17 \ No newline at end of file diff --git a/16 - Lunch Break/5.txt b/16 - Lunch Break/5.txt new file mode 100644 index 0000000..8846e05 --- /dev/null +++ b/16 - Lunch Break/5.txt @@ -0,0 +1,13 @@ +12 +826 8 +763 22 +701 41 +638 31 +565 18 +542 19 +483 38 +410 38 +332 36 +247 52 +156 48 +60 53 \ No newline at end of file diff --git a/16 - Lunch Break/6.txt b/16 - Lunch Break/6.txt new file mode 100644 index 0000000..c6ca0f5 --- /dev/null +++ b/16 - Lunch Break/6.txt @@ -0,0 +1,3 @@ +2 +1439 1 +1 1 \ No newline at end of file diff --git a/16 - Lunch Break/7.txt b/16 - Lunch Break/7.txt new file mode 100644 index 0000000..9f3673f --- /dev/null +++ b/16 - Lunch Break/7.txt @@ -0,0 +1,51 @@ +50 +0 1 +53 1 +96 1 +115 1 +122 1 +171 1 +187 1 +214 1 +229 1 +244 1 +300 1 +356 1 +364 1 +388 1 +428 1 +440 1 +456 1 +458 1 +468 1 +478 1 +481 1 +523 1 +577 1 +636 1 +697 1 +708 1 +725 1 +780 1 +814 1 +862 1 +909 1 +953 1 +968 1 +981 1 +1018 1 +1039 1 +1063 1 +1087 1 +1101 1 +1125 1 +1132 1 +1175 1 +1185 1 +1196 1 +1199 1 +1226 1 +1266 1 +1327 1 +1356 1 +1364 1 \ No newline at end of file diff --git a/16 - Lunch Break/8.txt b/16 - Lunch Break/8.txt new file mode 100644 index 0000000..04228ea --- /dev/null +++ b/16 - Lunch Break/8.txt @@ -0,0 +1,76 @@ +75 +141 2 +727 2 +554 3 +574 5 +1232 5 +1254 1 +606 2 +254 2 +923 4 +1422 4 +1189 5 +295 2 +690 5 +1214 5 +954 3 +697 5 +859 2 +621 3 +654 4 +916 1 +887 4 +836 3 +495 4 +207 1 +1029 1 +997 4 +1369 5 +1295 5 +943 4 +2 2 +660 3 +970 4 +1155 4 +304 1 +111 4 +791 3 +1320 2 +55 3 +1081 4 +274 2 +224 3 +0 1 +1124 3 +1337 3 +745 5 +640 2 +1243 2 +478 3 +1393 5 +392 3 +81 3 +761 5 +523 4 +1075 5 +1149 1 +161 5 +361 5 +314 1 +196 1 +414 2 +27 2 +521 1 +1104 5 +472 5 +340 5 +1271 2 +585 4 +284 3 +91 2 +810 1 +439 3 +1050 5 +1208 2 +482 5 +489 4 \ No newline at end of file diff --git a/16 - Lunch Break/9.txt b/16 - Lunch Break/9.txt new file mode 100644 index 0000000..7a84778 --- /dev/null +++ b/16 - Lunch Break/9.txt @@ -0,0 +1,101 @@ +100 +511 4 +593 5 +179 5 +111 4 +362 4 +903 1 +671 1 +184 5 +550 1 +515 1 +175 4 +561 5 +120 2 +902 1 +382 2 +388 5 +518 2 +630 3 +779 1 +854 3 +641 5 +835 3 +649 4 +504 2 +865 4 +716 2 +357 5 +325 2 +195 2 +906 4 +324 1 +122 5 +879 3 +10 3 +13 3 +672 3 +216 2 +556 3 +646 3 +191 4 +539 2 +145 2 +331 2 +393 3 +718 2 +627 3 +6 4 +861 4 +827 3 +904 2 +616 1 +197 4 +532 1 +781 3 +780 1 +304 5 +147 4 +622 5 +637 4 +720 5 +0 1 +327 4 +675 4 +560 1 +899 3 +658 1 +617 5 +850 4 +551 3 +807 4 +654 4 +569 2 +222 1 +802 5 +506 5 +516 2 +554 1 +1 5 +894 5 +321 3 +355 2 +857 4 +910 1 +189 2 +213 3 +653 1 +541 3 +589 4 +555 1 +715 1 +633 4 +88 5 +559 1 +115 5 +834 1 +874 5 +351 4 +384 4 +869 5 +614 2 \ No newline at end of file diff --git a/16 - Lunch Break/main.py b/16 - Lunch Break/main.py new file mode 100644 index 0000000..8792340 --- /dev/null +++ b/16 - Lunch Break/main.py @@ -0,0 +1,20 @@ +import sys + +meetings = sys.stdin.readline() +times = [] #holds both the start and end times + +#adds all the values to the times list +for i in range(int(meetings)): + start, length = sys.stdin.readline().split() + times.append(int(start)) + times.append(int(start) + int(length)) #end = start + length + +times.sort() #important because the meetings can come out of order + +maximum = 0 +for i in range(1, len(times) - 1, 2): #loops with an interval of 2 (all odd numbers) + end = times[i] #all end times are at odd indices + start = times[i + 1] #the start of the next meeting is the next item + maximum = max(maximum, start - end) #break = start of next - end of current + +print(maximum) \ No newline at end of file diff --git a/17 - Lemonade Stand/0.txt b/17 - Lemonade Stand/0.txt new file mode 100644 index 0000000..bf0d87a --- /dev/null +++ b/17 - Lemonade Stand/0.txt @@ -0,0 +1 @@ +4 \ No newline at end of file diff --git a/17 - Lemonade Stand/1.txt b/17 - Lemonade Stand/1.txt new file mode 100644 index 0000000..d8263ee --- /dev/null +++ b/17 - Lemonade Stand/1.txt @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/17 - Lemonade Stand/2.txt b/17 - Lemonade Stand/2.txt new file mode 100644 index 0000000..3f10ffe --- /dev/null +++ b/17 - Lemonade Stand/2.txt @@ -0,0 +1 @@ +15 \ No newline at end of file diff --git a/17 - Lemonade Stand/3.txt b/17 - Lemonade Stand/3.txt new file mode 100644 index 0000000..b74e882 --- /dev/null +++ b/17 - Lemonade Stand/3.txt @@ -0,0 +1 @@ +31 \ No newline at end of file diff --git a/17 - Lemonade Stand/4.txt b/17 - Lemonade Stand/4.txt new file mode 100644 index 0000000..86ee83a --- /dev/null +++ b/17 - Lemonade Stand/4.txt @@ -0,0 +1 @@ +40 \ No newline at end of file diff --git a/17 - Lemonade Stand/5.txt b/17 - Lemonade Stand/5.txt new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/17 - Lemonade Stand/5.txt @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/17 - Lemonade Stand/6.txt b/17 - Lemonade Stand/6.txt new file mode 100644 index 0000000..105d7d9 --- /dev/null +++ b/17 - Lemonade Stand/6.txt @@ -0,0 +1 @@ +100 \ No newline at end of file diff --git a/17 - Lemonade Stand/7.txt b/17 - Lemonade Stand/7.txt new file mode 100644 index 0000000..1199cd4 --- /dev/null +++ b/17 - Lemonade Stand/7.txt @@ -0,0 +1 @@ +219 \ No newline at end of file diff --git a/17 - Lemonade Stand/8.txt b/17 - Lemonade Stand/8.txt new file mode 100644 index 0000000..ee53032 --- /dev/null +++ b/17 - Lemonade Stand/8.txt @@ -0,0 +1 @@ +1052 \ No newline at end of file diff --git a/17 - Lemonade Stand/9.txt b/17 - Lemonade Stand/9.txt new file mode 100644 index 0000000..4ec24cc --- /dev/null +++ b/17 - Lemonade Stand/9.txt @@ -0,0 +1 @@ +12049 \ No newline at end of file diff --git a/17 - Lemonade Stand/main.py b/17 - Lemonade Stand/main.py new file mode 100644 index 0000000..1521813 --- /dev/null +++ b/17 - Lemonade Stand/main.py @@ -0,0 +1,10 @@ +import sys + +grapes = sys.stdin.readline() + +if int(grapes) % 4 == 0: + print('Greg') #Greg only wins if grapes are a multiple of four on Freddy's first turn + print((int(grapes) // 4) * 2) #it takes two turns to reduce the number of grapes by four +else: + print('Freddy') #otherwise, Freddy can make the grapes a multiple of four on Greg's first turn + print(1 + (int(grapes) // 4) * 2) #it takes one turn for freddy to do that \ No newline at end of file diff --git a/18 - Duck Latin/0.txt b/18 - Duck Latin/0.txt new file mode 100644 index 0000000..f9d0651 --- /dev/null +++ b/18 - Duck Latin/0.txt @@ -0,0 +1 @@ +duck latin \ No newline at end of file diff --git a/18 - Duck Latin/1.txt b/18 - Duck Latin/1.txt new file mode 100644 index 0000000..990d8a2 --- /dev/null +++ b/18 - Duck Latin/1.txt @@ -0,0 +1 @@ +a way \ No newline at end of file diff --git a/18 - Duck Latin/2.txt b/18 - Duck Latin/2.txt new file mode 100644 index 0000000..ec186f1 --- /dev/null +++ b/18 - Duck Latin/2.txt @@ -0,0 +1 @@ +string \ No newline at end of file diff --git a/18 - Duck Latin/3.txt b/18 - Duck Latin/3.txt new file mode 100644 index 0000000..881e2c7 --- /dev/null +++ b/18 - Duck Latin/3.txt @@ -0,0 +1 @@ +freddy is a duck \ No newline at end of file diff --git a/18 - Duck Latin/4.txt b/18 - Duck Latin/4.txt new file mode 100644 index 0000000..a974a47 --- /dev/null +++ b/18 - Duck Latin/4.txt @@ -0,0 +1 @@ +this string is written in english but should be converted to duck latin \ No newline at end of file diff --git a/18 - Duck Latin/5.txt b/18 - Duck Latin/5.txt new file mode 100644 index 0000000..0b5fb36 --- /dev/null +++ b/18 - Duck Latin/5.txt @@ -0,0 +1 @@ +pun a tat \ No newline at end of file diff --git a/18 - Duck Latin/6.txt b/18 - Duck Latin/6.txt new file mode 100644 index 0000000..f11125c --- /dev/null +++ b/18 - Duck Latin/6.txt @@ -0,0 +1 @@ +quack quack i am a duck so therefore i say quack quack \ No newline at end of file diff --git a/18 - Duck Latin/7.txt b/18 - Duck Latin/7.txt new file mode 100644 index 0000000..a8d9f53 --- /dev/null +++ b/18 - Duck Latin/7.txt @@ -0,0 +1 @@ +are there any words that start with four consonants like how string or throw start with three \ No newline at end of file diff --git a/18 - Duck Latin/8.txt b/18 - Duck Latin/8.txt new file mode 100644 index 0000000..ff98818 --- /dev/null +++ b/18 - Duck Latin/8.txt @@ -0,0 +1 @@ +does a word like schtschurowskia even count \ No newline at end of file diff --git a/18 - Duck Latin/9.txt b/18 - Duck Latin/9.txt new file mode 100644 index 0000000..46d00ad --- /dev/null +++ b/18 - Duck Latin/9.txt @@ -0,0 +1 @@ +schtschurowskia schtschurowskia schtschurowskia schtschurowskia schtschurowskia schtschurowskia schtschurowskia schtschurowskia schtschurowskia schtschurowskia \ No newline at end of file diff --git a/18 - Duck Latin/main.py b/18 - Duck Latin/main.py new file mode 100644 index 0000000..3fff579 --- /dev/null +++ b/18 - Duck Latin/main.py @@ -0,0 +1,15 @@ +import sys + +words = sys.stdin.readline().split() + +for i in range(len(words)): #loop over the sentence's words + + for j in range(len(words[i])): #loop over the word's characters + if words[i][j] in 'aeiou': #checks if vowel + break #stops the loop, preserving the value of j + + suffix = words[i][:j] or 'w' #gets the first j characters (or 'w' if j is 0) + remainder = words[i][j:] #gets the characters after j + words[i] = remainder + suffix + 'ack' #modifies the word + +print(' '.join(words)) #prints the words separated by a space \ No newline at end of file diff --git a/19 - Cart Calculations/0.txt b/19 - Cart Calculations/0.txt new file mode 100644 index 0000000..dcd6372 --- /dev/null +++ b/19 - Cart Calculations/0.txt @@ -0,0 +1,6 @@ +2 +Mask 3 +String 1 +2 +Mask 2 +String 3 \ No newline at end of file diff --git a/19 - Cart Calculations/1.txt b/19 - Cart Calculations/1.txt new file mode 100644 index 0000000..2a6e501 --- /dev/null +++ b/19 - Cart Calculations/1.txt @@ -0,0 +1,11 @@ +4 +Apples 10 +Bananas 20 +Cherries 30 +Dates 40 +5 +Apples 2 +Dates 1 +Bananas 2 +Apples 1 +Apples 2 \ No newline at end of file diff --git a/19 - Cart Calculations/2.txt b/19 - Cart Calculations/2.txt new file mode 100644 index 0000000..2cea71b --- /dev/null +++ b/19 - Cart Calculations/2.txt @@ -0,0 +1,7 @@ +2 +Fun 100 +Games 150 +3 +Fun 1 +Games 1 +Fun 1 \ No newline at end of file diff --git a/19 - Cart Calculations/3.txt b/19 - Cart Calculations/3.txt new file mode 100644 index 0000000..420e4ea --- /dev/null +++ b/19 - Cart Calculations/3.txt @@ -0,0 +1,8 @@ +4 +Mask 1 +BigMask 10 +ReallyBigMask 100 +Bedsheet 1000 +2 +Bedsheet 1 +Mask 1000 \ No newline at end of file diff --git a/19 - Cart Calculations/4.txt b/19 - Cart Calculations/4.txt new file mode 100644 index 0000000..2fa5c5d --- /dev/null +++ b/19 - Cart Calculations/4.txt @@ -0,0 +1,8 @@ +2 +Undo 10 +Windows10 1 +4 +Windows10 1 +Undo 1 +Undo 5 +Undo 120 \ No newline at end of file diff --git a/19 - Cart Calculations/5.txt b/19 - Cart Calculations/5.txt new file mode 100644 index 0000000..8e6c34c --- /dev/null +++ b/19 - Cart Calculations/5.txt @@ -0,0 +1,14 @@ +4 +Item1 +Item2 +Item3 +Item4 +8 +Item1 4 +Item3 2 +Item3 1 +Item1 4 +Item2 2 +Item1 2 +Item3 5 +Item2 1 \ No newline at end of file diff --git a/19 - Cart Calculations/6.txt b/19 - Cart Calculations/6.txt new file mode 100644 index 0000000..df0847c --- /dev/null +++ b/19 - Cart Calculations/6.txt @@ -0,0 +1,11 @@ +1 +Candy 4 +8 +Candy 1 +Candy 5 +Candy 9 +Candy 10 +Candy 27 +Candy 102 +Candy 1902 +Candy 29031 \ No newline at end of file diff --git a/19 - Cart Calculations/7.txt b/19 - Cart Calculations/7.txt new file mode 100644 index 0000000..97ae039 --- /dev/null +++ b/19 - Cart Calculations/7.txt @@ -0,0 +1,32 @@ +26 +A 1 +B 2 +C 3 +D 4 +E 5 +F 6 +G 7 +H 8 +I 9 +J 10 +K 11 +L 12 +M 13 +N 14 +O 15 +P 16 +Q 17 +R 18 +S 19 +T 20 +U 21 +V 22 +W 23 +X 24 +Y 25 +Z 26 +4 +Y 1 +M 1 +C 1 +A 1 \ No newline at end of file diff --git a/19 - Cart Calculations/8.txt b/19 - Cart Calculations/8.txt new file mode 100644 index 0000000..57b84de --- /dev/null +++ b/19 - Cart Calculations/8.txt @@ -0,0 +1,22 @@ +10 +1 0 +2 9 +3 8 +4 7 +5 6 +6 5 +7 4 +8 3 +9 2 +0 1 +10 +1 2 +3 4 +5 6 +7 8 +9 0 +0 9 +8 7 +6 5 +4 3 +2 1 \ No newline at end of file diff --git a/19 - Cart Calculations/9.txt b/19 - Cart Calculations/9.txt new file mode 100644 index 0000000..b9fd227 --- /dev/null +++ b/19 - Cart Calculations/9.txt @@ -0,0 +1,54 @@ +26 +A 261 +B 252 +C 243 +D 234 +E 225 +F 216 +G 207 +H 198 +I 189 +J 1710 +K 1611 +L 1512 +M 1413 +N 1314 +O 1215 +P 1116 +Q 1017 +R 918 +S 819 +T 720 +U 621 +V 522 +W 423 +X 324 +Y 225 +Z 126 +26 +Z 126 +Y 225 +W 423 +T 720 +P 1116 +K 1611 +E 225 +X 324 +P 1116 +G 207 +W 423 +L 1512 +Z 126 +M 1413 +Y 225 +J 1710 +T 720 +C 243 +K 1611 +R 918 +X 324 +C 243 +H 198 +K 1611 +M 1413 +N 1314 \ No newline at end of file diff --git a/19 - Cart Calculations/main.py b/19 - Cart Calculations/main.py new file mode 100644 index 0000000..9b9a255 --- /dev/null +++ b/19 - Cart Calculations/main.py @@ -0,0 +1,16 @@ +import sys + +prices = {} #this is a dictionary; it's a list with labels instead of indices +cost = 0 + +products = sys.stdin.readline() +for i in range(int(products)): + product, price = sys.stdin.readline().split() + prices[product] = int(price) #sets the price of each product in the dictionary + +cart = sys.stdin.readline() +for i in range(int(cart)): + product, quantity = sys.stdin.readline().split() + cost += prices[product] * int(quantity) #cost = price * quantity + +print(cost) \ No newline at end of file diff --git a/20 - Passwords/0.txt b/20 - Passwords/0.txt new file mode 100644 index 0000000..9665b8d --- /dev/null +++ b/20 - Passwords/0.txt @@ -0,0 +1,9 @@ +3 +AppleJack 1234 +BobbyPin ABCD +AppleJack 1234 +4 +CharlieHorse 1234 +BobbyPin ABCD +AppleJack ABCD +bobbypin abcd \ No newline at end of file diff --git a/20 - Passwords/1.txt b/20 - Passwords/1.txt new file mode 100644 index 0000000..064af67 --- /dev/null +++ b/20 - Passwords/1.txt @@ -0,0 +1,9 @@ +3 +username password +Username password +username Password +4 +username password +username Password +Username password +Username Password \ No newline at end of file diff --git a/20 - Passwords/2.txt b/20 - Passwords/2.txt new file mode 100644 index 0000000..c5f6391 --- /dev/null +++ b/20 - Passwords/2.txt @@ -0,0 +1,22 @@ +12 +A 1 +A 2 +A 3 +B 1 +B 2 +B 3 +C 1 +C 2 +C 3 +A 4 +B 4 +C 4 +8 +A 1 +B 2 +C 3 +D 4 +A 4 +B 4 +C 4 +D 4 \ No newline at end of file diff --git a/20 - Passwords/3.txt b/20 - Passwords/3.txt new file mode 100644 index 0000000..497ff8d --- /dev/null +++ b/20 - Passwords/3.txt @@ -0,0 +1,8 @@ +2 +ABC 1 +ABC 2 +4 +ABC 2 +ABC 1 +abc 1 +abc 2 \ No newline at end of file diff --git a/20 - Passwords/4.txt b/20 - Passwords/4.txt new file mode 100644 index 0000000..7471baf --- /dev/null +++ b/20 - Passwords/4.txt @@ -0,0 +1,17 @@ +9 +96 LB +96 LB +96 LB +96 LB +96 LB +96 LB +96 LB +96 LB +96 LB +6 +96 LB +96 LB +96 LB +96 LB +96 LB +96 LB \ No newline at end of file diff --git a/20 - Passwords/5.txt b/20 - Passwords/5.txt new file mode 100644 index 0000000..181decb --- /dev/null +++ b/20 - Passwords/5.txt @@ -0,0 +1,18 @@ +8 +Freddy Freddie +freddy freddi +Freddie Freddie +freddie freddi +Freddi freddie +freddi Freddy +Freddy freddy +freddy Freddy +8 +Freddi freddie +fredy Freddy +Freddie Freddie +freddie Freddy +Freddy Freddie +freddy freddi +freddi freddy +freddy Freddy \ No newline at end of file diff --git a/20 - Passwords/6.txt b/20 - Passwords/6.txt new file mode 100644 index 0000000..6fb38f8 --- /dev/null +++ b/20 - Passwords/6.txt @@ -0,0 +1,25 @@ +15 +apple 1 +banana 1 +apple 2 +cherry 1 +apple 3 +banana 2 +apple 4 +date 1 +apple 5 +banana 3 +apple 6 +cherry 2 +apple 7 +banana 4 +apple 8 +8 +date 8 +apple 8 +cherry 1 +banana 1 +banana 2 +apple 8 +apple 1 +date 1 \ No newline at end of file diff --git a/20 - Passwords/7.txt b/20 - Passwords/7.txt new file mode 100644 index 0000000..5b1ea39 --- /dev/null +++ b/20 - Passwords/7.txt @@ -0,0 +1,54 @@ +26 +A 1 +B 2 +C 3 +D 4 +E 5 +F 6 +G 7 +H 8 +I 9 +J 10 +K 11 +L 12 +M 13 +N 14 +O 15 +P 16 +Q 17 +R 18 +S 19 +T 20 +U 21 +V 22 +W 23 +X 24 +Y 25 +Z 26 +26 +a 1 +b 2 +c 3 +d 4 +e 5 +f 6 +g 7 +h 8 +i 9 +j 10 +k 11 +l 12 +m 13 +n 14 +o 15 +p 16 +q 17 +r 18 +s 19 +t 20 +u 21 +v 22 +w 23 +x 24 +y 25 +z 26 \ No newline at end of file diff --git a/20 - Passwords/8.txt b/20 - Passwords/8.txt new file mode 100644 index 0000000..c98ae26 --- /dev/null +++ b/20 - Passwords/8.txt @@ -0,0 +1,74 @@ +36 +A 1 +B 2 +C 3 +D 4 +E 5 +F 6 +G 7 +H 8 +I 9 +J 10 +K 11 +L 12 +M 13 +N 14 +O 15 +P 16 +Q 17 +R 18 +S 19 +T 20 +U 21 +V 22 +W 23 +X 24 +Y 25 +Z 26 +0 A +1 B +2 C +3 D +4 E +5 F +6 G +7 H +8 I +9 J +36 +A 1 +B 2 +C 3 +D 4 +E 5 +F 6 +G 7 +H 8 +I 9 +J 10 +K 11 +L 12 +M 13 +N 14 +O 15 +P 16 +Q 17 +R 18 +S 19 +T 20 +U 21 +V 22 +W 23 +X 24 +Y 25 +Z 26 +0 a +1 b +2 c +3 d +4 e +5 f +6 g +7 h +8 i +9 j \ No newline at end of file diff --git a/20 - Passwords/9.txt b/20 - Passwords/9.txt new file mode 100644 index 0000000..ff131bf --- /dev/null +++ b/20 - Passwords/9.txt @@ -0,0 +1,152 @@ +75 +Mjgr hGixExEO +ZKro iLKvLXjq +04FB 6pZvDNlh +SQLf nxCzphXg +fZqr 7i5ShRD9 +yJQM mqSTHvXt +HmTq bDdF02O7 +gLIC Q6H1n6DG +jNsr 6PkYbOpM +hTD7 zmyZvYXy +VOgI aXW0njtQ +Jfy1 0PlDI1Oz +Uomy nXf5W9nT +l9RX pn31MLvi +5704 nTndigyD +xF85 2KBiUH6r +Uomy nXf5W9nT +8W81 M6AlxYhD +0vph Tnuv96Ef +Ytsf YeYE66Ly +ssjq lCM60grj +czcX t7wVqp8a +o54n sDqXhgAB +EbZy zW2MKvTk +7LpP vz1sImTh +ZhUm uOmx7SRT +WL9c 0NVoRyFh +0vph Tnuv96Ef +cETO tDSrGEkC +wkuS iefjTYAs +r1u9 7DMaPPPT +EJ60 vuGz94OJ +SI3w X2AkyBRl +6o3c eLZZnHy0 +gXOJ GsyDiLxe +PXMd OfQnkCQJ +tns1 DaZIJatO +ohJc VZgDAFu7 +1TJx qy5YejUz +Y5wn K3jooFMy +ssjq lCM60grj +ohJc VZgDAFu7 +czcX t7wVqp8a +EbZy zW2MKvTk +KwmP 0ZmpfOZs +Ytsf YeYE66Ly +8bKU vhpgQVaI +yJQM mqSTHvXt +gLIC Q6H1n6DG +WL9c 0NVoRyFh +SI3w X2AkyBRl +7LpP vz1sImTh +zERn 1pVKDPXT +LWSe b41J8oKq +qVny 23hUOdCc +TjjG jPOBBgXJ +pGel 37g2TmnK +xF85 2KBiUH6r +tns1 DaZIJatO +ZBf6 7vRpftRe +8W81 M6AlxYhD +6o3c eLZZnHy0 +r1u9 7DMaPPPT +0xAQ 3M6pk31r +yR64 oK20yBHm +o54n sDqXhgAB +jNsr 6PkYbOpM +cETO tDSrGEkC +TjjG jPOBBgXJ +0xAQ 3M6pk31r +04FB 6pZvDNlh +oZGt R8FMwd9q +HmTq bDdF02O7 +PXMd OfQnkCQJ +GOhZ WVkTEzew +75 +mGyM 6Inl37mV +8W81 FzHRR8st +Mjgr hGixExEO +EbZy mzcTrDTs +Y5wn JMmwTDZa +gXOJ iAjB6tjI +SI3w 7WhuWo66 +WL9c gHOJuh48 +zERn EnYEkmNX +LWSe b41J8oKq +tns1 XL0hradz +TjjG jPOBBgXJ +ZhUm uOmx7SRT +cETO gy81Y0iH +b3bf Hxx68lik +PXMd jBxuBlDV +oZGt R8FMwd9q +yR64 XMsLYj4Y +scRv sm3F1E9W +yJQM mqSTHvXt +qtZk 3QACRXJS +qUFn RNa6pSG4 +hTD7 902NZxUu +36Pc GTvbcyFJ +I4Kd 0V99hHPt +pGel Lzdjjr0v +o54n mZ1B6ag8 +Av7l ai0bM2rC +GOhZ WVkTEzew +swIE k1AISHbZ +SQLf 8kYFP6Ie +DqEs CDt9oHqk +wkuS iefjTYAs +11Ww l246VHBd +xSc1 2szOZqja +HmTq iyxYL2PI +Uomy pZl6Ez9q +EJ60 8TSCfDYk +l9RX OcJmoBTI +FcDk BkNMu6kT +1TJx tLkYPz3L +IUAx CloxeSMF +VOgI M042j5zJ +0hem rvV8EswC +sIoq aGALaIwg +Jfy1 POCo8QQ0 +suCW hHUmrE7Z +04FB 6pZvDNlh +KwmP xkN4dipl +czcX RNb76aKo +saJp 3Z1W60Ol +ohJc sqT7MxQV +j1US aroX3CS3 +ZBf6 7vRpftRe +8bKU vhpgQVaI +Y9yb OQNmmAAB +Ytsf RoRVgk6H +0xAQ IDdjLkJH +ZKro P16aMFO6 +qVny 23hUOdCc +Xa9S DbC4Cxfi +jNsr 6PkYbOpM +7LpP dFWwHQ9m +ssjq lCM60grj +gLIC 7l2lT2RN +xF85 n2UaBpDh +5704 hhrNlCPa +yhsm HAkDJozh +r1u9 BSDRNPiB +toHo gRzMndk1 +p29m wjmzX6mq +t2Dh RvbmFLqz +0vph Tnuv96Ef +fZqr 7i5ShRD9 +6o3c eLZZnHy0 \ No newline at end of file diff --git a/20 - Passwords/main.py b/20 - Passwords/main.py new file mode 100644 index 0000000..00ef3b9 --- /dev/null +++ b/20 - Passwords/main.py @@ -0,0 +1,22 @@ +import sys + +accounts = {} #a dictionary for username/password pairs + +registrations = sys.stdin.readline() +for i in range(int(registrations)): + username, password = sys.stdin.readline().split() + if username in accounts: #if the username is already registered, it's bad + print('Bad Username') + else: #otherwise, register it + accounts[username] = password + print('Success') + +print() #blank line for clarity + +logins = sys.stdin.readline() +for i in range(int(logins)): + username, password = sys.stdin.readline().split() + if username not in accounts: #if the username is not registered, it's bad + print('Bad Username') + else: #otherwise, check the password + print('Success' if accounts[username] == password else 'Bad Password') #python lets you use if statements as expressions \ No newline at end of file diff --git a/21 - MAD/0.txt b/21 - MAD/0.txt new file mode 100644 index 0000000..86f3a06 --- /dev/null +++ b/21 - MAD/0.txt @@ -0,0 +1,4 @@ +3 3 +45 60 75 +0 0 0 +60 0 30 \ No newline at end of file diff --git a/21 - MAD/1.txt b/21 - MAD/1.txt new file mode 100644 index 0000000..7ea6540 --- /dev/null +++ b/21 - MAD/1.txt @@ -0,0 +1,3 @@ +2 4 +0 0 100 100 +0 30 70 100 \ No newline at end of file diff --git a/21 - MAD/2.txt b/21 - MAD/2.txt new file mode 100644 index 0000000..a942e2d --- /dev/null +++ b/21 - MAD/2.txt @@ -0,0 +1,5 @@ +4 2 +0 0 +0 20 +100 80 +100 100 \ No newline at end of file diff --git a/21 - MAD/3.txt b/21 - MAD/3.txt new file mode 100644 index 0000000..e2d31ce --- /dev/null +++ b/21 - MAD/3.txt @@ -0,0 +1,5 @@ +4 4 +75 89 56 60 +79 105 32 64 +53 55 36 44 +13 17 9 13 \ No newline at end of file diff --git a/21 - MAD/4.txt b/21 - MAD/4.txt new file mode 100644 index 0000000..b4e47b0 --- /dev/null +++ b/21 - MAD/4.txt @@ -0,0 +1,5 @@ +4 8 +87 56 65 60 38 36 53 37 +71 97 66 98 39 23 59 43 +72 45 107 44 42 15 5 22 +64 85 52 67 12 45 45 46 \ No newline at end of file diff --git a/21 - MAD/5.txt b/21 - MAD/5.txt new file mode 100644 index 0000000..e2efbc6 --- /dev/null +++ b/21 - MAD/5.txt @@ -0,0 +1,9 @@ +8 2 +78 0 +42 40 +56 20 +54 30 +57 17 +57 11 +64 8 +39 35 \ No newline at end of file diff --git a/21 - MAD/6.txt b/21 - MAD/6.txt new file mode 100644 index 0000000..e63ec2b --- /dev/null +++ b/21 - MAD/6.txt @@ -0,0 +1,7 @@ +6 6 +72 72 72 72 72 72 +60 95 61 22 54 56 +70 89 72 37 48 38 +60 53 52 46 47 48 +31 31 31 31 31 31 +50 47 50 45 44 46 \ No newline at end of file diff --git a/21 - MAD/7.txt b/21 - MAD/7.txt new file mode 100644 index 0000000..cc0041a --- /dev/null +++ b/21 - MAD/7.txt @@ -0,0 +1,9 @@ +8 8 +5 5 5 5 5 5 5 5 +5 5 5 5 5 5 5 5 +5 7 7 5 4 5 5 2 +5 6 7 6 3 5 3 5 +5 6 6 7 4 5 4 3 +5 5 5 5 5 5 5 5 +5 6 5 8 5 3 3 5 +5 5 5 5 5 5 5 5 \ No newline at end of file diff --git a/21 - MAD/8.txt b/21 - MAD/8.txt new file mode 100644 index 0000000..736c0d4 --- /dev/null +++ b/21 - MAD/8.txt @@ -0,0 +1,7 @@ +6 12 +82 82 82 83 84 85 81 80 81 82 82 80 +53 59 53 53 53 59 53 49 51 51 50 52 +88 72 62 58 57 59 51 48 47 56 54 32 +47 54 49 77 58 45 18 25 37 34 27 21 +51 61 51 59 50 52 50 43 50 37 47 49 +58 45 35 35 44 35 27 26 28 29 31 27 \ No newline at end of file diff --git a/21 - MAD/9.txt b/21 - MAD/9.txt new file mode 100644 index 0000000..35578a3 --- /dev/null +++ b/21 - MAD/9.txt @@ -0,0 +1,13 @@ +12 6 +62 64 60 46 52 46 +71 63 94 43 17 42 +77 70 75 37 52 49 +71 64 66 50 45 40 +66 84 78 61 41 36 +81 66 66 17 53 47 +52 62 72 27 44 37 +78 59 82 35 40 30 +59 59 53 51 43 47 +96 88 68 31 0 41 +57 58 65 26 42 46 +48 68 67 27 33 45 \ No newline at end of file diff --git a/21 - MAD/main.py b/21 - MAD/main.py new file mode 100644 index 0000000..25b0318 --- /dev/null +++ b/21 - MAD/main.py @@ -0,0 +1,33 @@ +import sys + +#finds the average of the data +def avg(data): + total = 0 + + for i in data: + total += int(i) #adds the value + + return total / len(data) #returns the average + +#finds the mean absolute deviation of the data +def mad(data): + mean = avg(data) + total = 0 + + for i in data: + total += abs(int(i) - mean) #adds the absolute difference + + return total / len(data) #returns the average difference + +masks, judges = sys.stdin.readline().split() +avgs = [] #the mean of each mask's scores +mads = [] #the mean absolute deviation of each mask's scores + +for i in range(int(masks)): + scores = sys.stdin.readline().split() + avgs.append(avg(scores)) #adds the avg + mads.append(mad(scores)) #adds the mad + +print(int(mad(avgs))) #the mad of the data as a whole +for i in mads: + print(int(i)) #the mad of each mask's scores \ No newline at end of file diff --git a/22 - Materials Science/0.txt b/22 - Materials Science/0.txt new file mode 100644 index 0000000..e53b6e5 --- /dev/null +++ b/22 - Materials Science/0.txt @@ -0,0 +1,7 @@ +6 5 +10000 +00000 +00000 +11001 +01000 +00000 \ No newline at end of file diff --git a/22 - Materials Science/1.txt b/22 - Materials Science/1.txt new file mode 100644 index 0000000..b6c006e --- /dev/null +++ b/22 - Materials Science/1.txt @@ -0,0 +1,4 @@ +3 8 +10101010 +00000000 +01010101 \ No newline at end of file diff --git a/22 - Materials Science/2.txt b/22 - Materials Science/2.txt new file mode 100644 index 0000000..6e23964 --- /dev/null +++ b/22 - Materials Science/2.txt @@ -0,0 +1,4 @@ +4 6 +000000 +000000 +000000 \ No newline at end of file diff --git a/22 - Materials Science/3.txt b/22 - Materials Science/3.txt new file mode 100644 index 0000000..9d91af2 --- /dev/null +++ b/22 - Materials Science/3.txt @@ -0,0 +1,6 @@ +5 5 +10000 +00001 +00100 +01000 +00010 \ No newline at end of file diff --git a/22 - Materials Science/4.txt b/22 - Materials Science/4.txt new file mode 100644 index 0000000..912313a --- /dev/null +++ b/22 - Materials Science/4.txt @@ -0,0 +1,2 @@ +1 8 +00000000 \ No newline at end of file diff --git a/22 - Materials Science/5.txt b/22 - Materials Science/5.txt new file mode 100644 index 0000000..37d95f1 --- /dev/null +++ b/22 - Materials Science/5.txt @@ -0,0 +1,10 @@ +9 9 +110000000 +100000000 +000000000 +000010000 +000111000 +100010000 +000000000 +000001000 +000011100 \ No newline at end of file diff --git a/22 - Materials Science/6.txt b/22 - Materials Science/6.txt new file mode 100644 index 0000000..8b33b70 --- /dev/null +++ b/22 - Materials Science/6.txt @@ -0,0 +1,10 @@ +9 6 +111111 +111111 +111111 +111111 +111111 +111111 +111111 +111111 +111111 \ No newline at end of file diff --git a/22 - Materials Science/7.txt b/22 - Materials Science/7.txt new file mode 100644 index 0000000..0d7841b --- /dev/null +++ b/22 - Materials Science/7.txt @@ -0,0 +1,13 @@ +12 12 +000100010000 +111111110000 +000000010000 +000000010000 +000000010000 +000000010000 +111111111111 +000000000000 +000000000000 +000000000000 +000000000000 +000000000000 \ No newline at end of file diff --git a/22 - Materials Science/8.txt b/22 - Materials Science/8.txt new file mode 100644 index 0000000..aee27de --- /dev/null +++ b/22 - Materials Science/8.txt @@ -0,0 +1,9 @@ +8 20 +00100000001100000100 +01110000001000000100 +00000000000000000000 +01000000000000000100 +00000000000000000000 +01000000001000000111 +01010000001000000000 +00000000000000000000 \ No newline at end of file diff --git a/22 - Materials Science/9.txt b/22 - Materials Science/9.txt new file mode 100644 index 0000000..8325934 --- /dev/null +++ b/22 - Materials Science/9.txt @@ -0,0 +1,21 @@ +20 20 +00000000000000000000 +01110111101111111110 +01110111101111111110 +00000000000000000000 +01110111101111111110 +01110111101111111110 +00000000000000000000 +01110111101111111110 +01110111101111111110 +01110111101111111110 +01110111101111111110 +01110111101111111110 +01110111101111111110 +01110111101111111110 +00000000000000000000 +01110111101111111110 +00000000000000000000 +01110111101111111110 +01110111101111111110 +00000000000000000000 \ No newline at end of file diff --git a/22 - Materials Science/main.py b/22 - Materials Science/main.py new file mode 100644 index 0000000..6e537c6 --- /dev/null +++ b/22 - Materials Science/main.py @@ -0,0 +1,23 @@ +import sys + +height, width = sys.stdin.readline().split() +matrix = sys.stdin.readlines() +rows = cols = 0 #number of empty rows and columns + +#counts all of the empty rows +for row in matrix: + if '1' not in row: #a row is empty if there are no 1's + rows += 1 + +#iterating over columns is a little harder +for col in range(int(width)): + empty = True #first, we assume it's empty + for row in matrix: #then we loop over every row + if row[col] == '1': #if there's a 1, the column isn't empty + empty = False #we can stop searching now + break + + if empty: #if we found no 1's, then it's an empty column + cols += 1 + +print(max(rows, cols)) #a fabric can fix 1 empty row and 1 empty column simultaneously \ No newline at end of file diff --git a/23 - Shipping and Handling/0.txt b/23 - Shipping and Handling/0.txt new file mode 100644 index 0000000..f2dd579 --- /dev/null +++ b/23 - Shipping and Handling/0.txt @@ -0,0 +1,5 @@ +4 10 +4 +2 +5 +11 \ No newline at end of file diff --git a/23 - Shipping and Handling/1.txt b/23 - Shipping and Handling/1.txt new file mode 100644 index 0000000..96c4da6 --- /dev/null +++ b/23 - Shipping and Handling/1.txt @@ -0,0 +1,3 @@ +3 2 +4 +5 \ No newline at end of file diff --git a/23 - Shipping and Handling/2.txt b/23 - Shipping and Handling/2.txt new file mode 100644 index 0000000..21b221d --- /dev/null +++ b/23 - Shipping and Handling/2.txt @@ -0,0 +1,7 @@ +6 12 +5 +2 +6 +2 +9 +4 \ No newline at end of file diff --git a/23 - Shipping and Handling/3.txt b/23 - Shipping and Handling/3.txt new file mode 100644 index 0000000..a6bc101 --- /dev/null +++ b/23 - Shipping and Handling/3.txt @@ -0,0 +1,6 @@ +5 20 +1 +2 +3 +4 +5 \ No newline at end of file diff --git a/23 - Shipping and Handling/4.txt b/23 - Shipping and Handling/4.txt new file mode 100644 index 0000000..4604e5f --- /dev/null +++ b/23 - Shipping and Handling/4.txt @@ -0,0 +1,8 @@ +7 21 +3 +11 +15 +8 +14 +14 +8 \ No newline at end of file diff --git a/23 - Shipping and Handling/5.txt b/23 - Shipping and Handling/5.txt new file mode 100644 index 0000000..f71d338 --- /dev/null +++ b/23 - Shipping and Handling/5.txt @@ -0,0 +1,7 @@ +6 204 +58 +32 +108 +74 +49 +65 \ No newline at end of file diff --git a/23 - Shipping and Handling/6.txt b/23 - Shipping and Handling/6.txt new file mode 100644 index 0000000..2579f73 --- /dev/null +++ b/23 - Shipping and Handling/6.txt @@ -0,0 +1,8 @@ +7 311 +65 +77 +96 +112 +109 +75 +81 \ No newline at end of file diff --git a/23 - Shipping and Handling/7.txt b/23 - Shipping and Handling/7.txt new file mode 100644 index 0000000..4568ef5 --- /dev/null +++ b/23 - Shipping and Handling/7.txt @@ -0,0 +1,9 @@ +8 14 +13 +2 +2 +2 +2 +2 +2 +2 \ No newline at end of file diff --git a/23 - Shipping and Handling/8.txt b/23 - Shipping and Handling/8.txt new file mode 100644 index 0000000..309c962 --- /dev/null +++ b/23 - Shipping and Handling/8.txt @@ -0,0 +1,10 @@ +9 1041 +524 +681 +620 +128 +410 +311 +204 +891 +1 \ No newline at end of file diff --git a/23 - Shipping and Handling/9.txt b/23 - Shipping and Handling/9.txt new file mode 100644 index 0000000..913857c --- /dev/null +++ b/23 - Shipping and Handling/9.txt @@ -0,0 +1,11 @@ +10 10489 +504 +2304 +781 +4560 +6590 +816 +1024 +964 +2119 +1718 \ No newline at end of file diff --git a/23 - Shipping and Handling/main.py b/23 - Shipping and Handling/main.py new file mode 100644 index 0000000..9995ac5 --- /dev/null +++ b/23 - Shipping and Handling/main.py @@ -0,0 +1,22 @@ +import sys + +items, capacity = sys.stdin.readline().split() +weights = sys.stdin.readlines() + +#index - the item that was last placed on the truck +#weight - the current weight of the truck +def recursive(index, weight): + if weight > int(capacity): + return 0 #don't run the function if the truck is overloaded + + maximum = weight #maximum weight that can be added to the truck + for i in range(index + 1, len(weights)): #only looks at items after the last one to prevent duplicates + #this function calls itself to find the maximum possible weight + #that can be added to the current weight using only the remaining items + maximum = max(maximum, recursive(i, weight + int(weights[i]))) + + return maximum + +#we call recursive(-1, 0) to indicate that the truck is empty +#it will return the maximum possible weight using all the items +print(recursive(-1, 0)) \ No newline at end of file diff --git a/24 - Contact Tracing/0.txt b/24 - Contact Tracing/0.txt new file mode 100644 index 0000000..1c1b22d --- /dev/null +++ b/24 - Contact Tracing/0.txt @@ -0,0 +1,6 @@ +5 +0 1 +1 2 +2 0 +3 4 +5 2 \ No newline at end of file diff --git a/24 - Contact Tracing/1.txt b/24 - Contact Tracing/1.txt new file mode 100644 index 0000000..9090109 --- /dev/null +++ b/24 - Contact Tracing/1.txt @@ -0,0 +1,5 @@ +4 +1 2 +2 3 +3 4 +0 1 \ No newline at end of file diff --git a/24 - Contact Tracing/2.txt b/24 - Contact Tracing/2.txt new file mode 100644 index 0000000..16c193c --- /dev/null +++ b/24 - Contact Tracing/2.txt @@ -0,0 +1,4 @@ +3 +1 2 +2 4 +4 8 \ No newline at end of file diff --git a/24 - Contact Tracing/3.txt b/24 - Contact Tracing/3.txt new file mode 100644 index 0000000..9bf4e1a --- /dev/null +++ b/24 - Contact Tracing/3.txt @@ -0,0 +1,11 @@ +10 +0 1 +1 2 +3 4 +2 4 +2 5 +1 6 +8 9 +9 10 +8 10 +11 6 \ No newline at end of file diff --git a/24 - Contact Tracing/4.txt b/24 - Contact Tracing/4.txt new file mode 100644 index 0000000..7ede4b6 --- /dev/null +++ b/24 - Contact Tracing/4.txt @@ -0,0 +1,11 @@ +12 +0 8 +4 2 +5 2 +0 7 +4 6 +9 1 +3 9 +7 1 +5 6 +10 1 \ No newline at end of file diff --git a/24 - Contact Tracing/5.txt b/24 - Contact Tracing/5.txt new file mode 100644 index 0000000..e5590a2 --- /dev/null +++ b/24 - Contact Tracing/5.txt @@ -0,0 +1,15 @@ +14 +15 14 +14 13 +13 12 +12 11 +11 10 +10 9 +9 8 +8 7 +7 6 +6 5 +5 4 +4 3 +3 2 +2 1 \ No newline at end of file diff --git a/24 - Contact Tracing/6.txt b/24 - Contact Tracing/6.txt new file mode 100644 index 0000000..c0985c9 --- /dev/null +++ b/24 - Contact Tracing/6.txt @@ -0,0 +1,16 @@ +15 +15 14 +14 13 +13 12 +12 11 +11 10 +10 9 +9 8 +8 7 +7 6 +6 5 +5 4 +4 3 +3 2 +2 1 +1 0 \ No newline at end of file diff --git a/24 - Contact Tracing/7.txt b/24 - Contact Tracing/7.txt new file mode 100644 index 0000000..33bbce7 --- /dev/null +++ b/24 - Contact Tracing/7.txt @@ -0,0 +1,19 @@ +18 +7 9 +6 2 +9 11 +5 7 +10 2 +13 3 +8 4 +11 13 +7 3 +3 5 +7 13 +1 13 +12 6 +11 7 +4 6 +6 10 +0 12 +8 6 \ No newline at end of file diff --git a/24 - Contact Tracing/8.txt b/24 - Contact Tracing/8.txt new file mode 100644 index 0000000..d2e5d1d --- /dev/null +++ b/24 - Contact Tracing/8.txt @@ -0,0 +1,26 @@ +25 +25 11 +14 23 +23 12 +5 20 +12 0 +19 25 +24 15 +21 10 +25 6 +15 5 +15 10 +15 6 +1 12 +19 18 +10 2 +23 0 +25 14 +18 0 +21 17 +21 7 +7 23 +3 25 +9 4 +10 12 +1 20 \ No newline at end of file diff --git a/24 - Contact Tracing/9.txt b/24 - Contact Tracing/9.txt new file mode 100644 index 0000000..0076940 --- /dev/null +++ b/24 - Contact Tracing/9.txt @@ -0,0 +1,51 @@ +50 +34 19 +19 25 +37 5 +48 32 +35 1 +41 13 +45 39 +48 11 +33 40 +33 49 +38 12 +49 39 +32 12 +39 42 +37 22 +27 9 +36 20 +44 35 +34 49 +33 24 +7 6 +20 44 +3 7 +0 10 +33 0 +9 37 +27 35 +22 23 +36 18 +5 17 +48 10 +9 12 +29 15 +48 18 +5 11 +16 32 +18 50 +3 9 +42 15 +30 35 +19 20 +38 43 +5 39 +20 45 +7 25 +44 24 +1 25 +16 8 +44 26 +24 44 \ No newline at end of file diff --git a/24 - Contact Tracing/main.py b/24 - Contact Tracing/main.py new file mode 100644 index 0000000..06a7cd4 --- /dev/null +++ b/24 - Contact Tracing/main.py @@ -0,0 +1,19 @@ +import sys + +count = sys.stdin.readline() +contacts = sys.stdin.readlines() +needs_test = {'0'} #this is a set, which is a list that doesn't allow duplicates +tests = 1 #Freddy needs a test + +#we check all the contacts multiple times to account for indirect contacts +for i in range(int(count)): + for j in contacts: + a, b = j.split() + + #if one needs a test, both need a test + if a in needs_test or b in needs_test: + #adding to a set has no effect if the item is already present + needs_test.add(a) + needs_test.add(b) + +print(len(needs_test)) #count the number of people who need tests \ No newline at end of file diff --git a/25 - GPS Malfunction/0.txt b/25 - GPS Malfunction/0.txt new file mode 100644 index 0000000..5caa7fd --- /dev/null +++ b/25 - GPS Malfunction/0.txt @@ -0,0 +1,13 @@ +8 12 +0 1 +0 2 +1 3 +2 3 +2 4 +3 4 +3 6 +4 5 +4 6 +4 7 +5 7 +6 7 \ No newline at end of file diff --git a/25 - GPS Malfunction/1.txt b/25 - GPS Malfunction/1.txt new file mode 100644 index 0000000..edccc22 --- /dev/null +++ b/25 - GPS Malfunction/1.txt @@ -0,0 +1,5 @@ +4 4 +3 1 +1 2 +0 1 +2 0 \ No newline at end of file diff --git a/25 - GPS Malfunction/2.txt b/25 - GPS Malfunction/2.txt new file mode 100644 index 0000000..ddebc18 --- /dev/null +++ b/25 - GPS Malfunction/2.txt @@ -0,0 +1,6 @@ +5 5 +1 0 +2 1 +3 2 +4 3 +0 4 \ No newline at end of file diff --git a/25 - GPS Malfunction/3.txt b/25 - GPS Malfunction/3.txt new file mode 100644 index 0000000..443968d --- /dev/null +++ b/25 - GPS Malfunction/3.txt @@ -0,0 +1,12 @@ +6 11 +0 1 +0 2 +0 3 +0 4 +1 2 +1 3 +1 4 +2 3 +2 4 +3 4 +4 5 \ No newline at end of file diff --git a/25 - GPS Malfunction/4.txt b/25 - GPS Malfunction/4.txt new file mode 100644 index 0000000..c71783f --- /dev/null +++ b/25 - GPS Malfunction/4.txt @@ -0,0 +1,12 @@ +11 11 +0 8 +4 2 +5 2 +0 7 +4 6 +9 1 +3 9 +7 1 +5 6 +4 1 +10 6 \ No newline at end of file diff --git a/25 - GPS Malfunction/5.txt b/25 - GPS Malfunction/5.txt new file mode 100644 index 0000000..483f7da --- /dev/null +++ b/25 - GPS Malfunction/5.txt @@ -0,0 +1,14 @@ +14 13 +0 1 +0 2 +0 3 +1 4 +1 5 +1 6 +2 7 +2 8 +2 9 +3 10 +11 3 +12 3 +13 8 \ No newline at end of file diff --git a/25 - GPS Malfunction/6.txt b/25 - GPS Malfunction/6.txt new file mode 100644 index 0000000..d557a2a --- /dev/null +++ b/25 - GPS Malfunction/6.txt @@ -0,0 +1,16 @@ +16 15 +15 14 +14 13 +13 12 +12 11 +11 10 +10 9 +9 8 +8 7 +7 6 +6 5 +5 4 +4 3 +3 2 +2 1 +1 0 \ No newline at end of file diff --git a/25 - GPS Malfunction/7.txt b/25 - GPS Malfunction/7.txt new file mode 100644 index 0000000..c820b92 --- /dev/null +++ b/25 - GPS Malfunction/7.txt @@ -0,0 +1,20 @@ +14 19 +7 9 +6 2 +9 11 +5 7 +10 2 +13 3 +8 4 +11 13 +7 3 +3 5 +7 13 +1 13 +12 6 +11 7 +4 6 +6 10 +0 12 +8 6 +8 9 \ No newline at end of file diff --git a/25 - GPS Malfunction/8.txt b/25 - GPS Malfunction/8.txt new file mode 100644 index 0000000..3bfda14 --- /dev/null +++ b/25 - GPS Malfunction/8.txt @@ -0,0 +1,25 @@ +20 24 +9 11 +13 8 +8 12 +5 14 +12 0 +16 9 +19 15 +4 10 +9 6 +15 5 +15 10 +15 6 +1 12 +16 18 +10 2 +8 0 +9 13 +18 0 +4 17 +4 7 +7 8 +3 9 +10 12 +1 14 \ No newline at end of file diff --git a/25 - GPS Malfunction/9.txt b/25 - GPS Malfunction/9.txt new file mode 100644 index 0000000..2b1717f --- /dev/null +++ b/25 - GPS Malfunction/9.txt @@ -0,0 +1,71 @@ +50 70 +0 1 +0 2 +0 3 +1 4 +1 5 +2 5 +3 6 +3 13 +13 14 +14 15 +15 16 +16 17 +17 18 +18 19 +6 9 +5 8 +4 7 +7 8 +7 10 +11 10 +7 12 +12 20 +12 21 +12 22 +12 9 +8 12 +19 21 +22 19 +20 23 +23 24 +25 28 +28 27 +27 26 +26 25 +25 27 +26 28 +29 28 +29 27 +29 25 +29 26 +25 3 +26 16 +27 24 +29 9 +28 11 +32 34 +32 33 +31 32 +31 33 +31 30 +30 11 +1 35 +35 37 +35 36 +36 20 +38 39 +39 40 +14 38 +40 41 +41 42 +43 44 +44 45 +45 22 +11 46 +46 47 +47 45 +23 48 +48 41 +43 49 +49 42 \ No newline at end of file diff --git a/25 - GPS Malfunction/main.py b/25 - GPS Malfunction/main.py new file mode 100644 index 0000000..4aecf68 --- /dev/null +++ b/25 - GPS Malfunction/main.py @@ -0,0 +1,21 @@ +import sys + +intersections, roads = sys.stdin.readline().split() +connections = sys.stdin.readlines() +distances = [None] * int(intersections) #holds the distance to each intersection +distances[0] = 0 #Freddy is 0 minutes from his starting position + +#we check all the roads multiple times to account for indirect connections +for i in range(int(roads)): + for j in connections: + a, b = j.split() + + #if a is reachable and b is not, set b + if distances[int(a)] == i and distances[int(b)] == None: + distances[int(b)] = i + 1 + + #if b is reachable and a is not, set b + if distances[int(b)] == i and distances[int(a)] == None: + distances[int(a)] = i + 1 + +print(distances[-1]) #return the distance to the last intersection \ No newline at end of file diff --git a/26 - QuHacks/0.txt b/26 - QuHacks/0.txt new file mode 100644 index 0000000..b4f3ad0 --- /dev/null +++ b/26 - QuHacks/0.txt @@ -0,0 +1,5 @@ +4 16 +2 +5 +3 +1 \ No newline at end of file diff --git a/26 - QuHacks/1.txt b/26 - QuHacks/1.txt new file mode 100644 index 0000000..96899af --- /dev/null +++ b/26 - QuHacks/1.txt @@ -0,0 +1,3 @@ +2 8 +1 +2 \ No newline at end of file diff --git a/26 - QuHacks/2.txt b/26 - QuHacks/2.txt new file mode 100644 index 0000000..4c51d22 --- /dev/null +++ b/26 - QuHacks/2.txt @@ -0,0 +1,4 @@ +100 3 +1 +100 +10000 \ No newline at end of file diff --git a/26 - QuHacks/3.txt b/26 - QuHacks/3.txt new file mode 100644 index 0000000..29d8bdb --- /dev/null +++ b/26 - QuHacks/3.txt @@ -0,0 +1,7 @@ +6 22 +1 +1 +3 +2 +5 +7 \ No newline at end of file diff --git a/26 - QuHacks/4.txt b/26 - QuHacks/4.txt new file mode 100644 index 0000000..c6e26c3 --- /dev/null +++ b/26 - QuHacks/4.txt @@ -0,0 +1,9 @@ +8 19 +6 +6 +6 +6 +6 +6 +6 +6 \ No newline at end of file diff --git a/26 - QuHacks/5.txt b/26 - QuHacks/5.txt new file mode 100644 index 0000000..e62ef60 --- /dev/null +++ b/26 - QuHacks/5.txt @@ -0,0 +1,10 @@ +9 112 +12 +13 +14 +15 +16 +17 +18 +19 +20 \ No newline at end of file diff --git a/26 - QuHacks/6.txt b/26 - QuHacks/6.txt new file mode 100644 index 0000000..183db78 --- /dev/null +++ b/26 - QuHacks/6.txt @@ -0,0 +1,9 @@ +8 500 +1 +1 +3 +3 +7 +7 +19 +19 \ No newline at end of file diff --git a/26 - QuHacks/7.txt b/26 - QuHacks/7.txt new file mode 100644 index 0000000..35d8a1e --- /dev/null +++ b/26 - QuHacks/7.txt @@ -0,0 +1,13 @@ +12 191 +2 +3 +5 +7 +11 +13 +17 +19 +23 +29 +31 +37 \ No newline at end of file diff --git a/26 - QuHacks/8.txt b/26 - QuHacks/8.txt new file mode 100644 index 0000000..9cc0411 --- /dev/null +++ b/26 - QuHacks/8.txt @@ -0,0 +1,16 @@ +15 491 +132 +210 +105 +482 +96 +180 +281 +301 +510 +113 +371 +432 +566 +102 +331 \ No newline at end of file diff --git a/26 - QuHacks/9.txt b/26 - QuHacks/9.txt new file mode 100644 index 0000000..13717e7 --- /dev/null +++ b/26 - QuHacks/9.txt @@ -0,0 +1,21 @@ +20 1000 +338 +703 +828 +301 +175 +752 +281 +765 +209 +128 +842 +177 +317 +929 +244 +636 +695 +339 +742 +814 \ No newline at end of file diff --git a/26 - QuHacks/main.py b/26 - QuHacks/main.py new file mode 100644 index 0000000..346600c --- /dev/null +++ b/26 - QuHacks/main.py @@ -0,0 +1,18 @@ +import sys + +machines, tests = sys.stdin.readline().split() +times = sys.stdin.readlines() +last = [0] * int(machines) #the time each machine is working until + +for i in range(int(tests)): #schedule each test, one by one + minimum = last[0] + int(times[0]) #the earliest time this test can be finished + mindex = 0 #the index of the machine that can finish this test earliest + + for j in range(1, len(last)): #loops over all the machines + if last[j] + int(times[j]) < minimum: #checks if this one can finish the test earlier + minimum = last[j] + int(times[j]) + mindex = j + + last[mindex] = minimum #schedules the test to the machine which can finish it earliest + +print(max(last)) #the total time taken is the the time the last machine takes \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..0fe2db3 --- /dev/null +++ b/main.py @@ -0,0 +1,61 @@ +import os, sys, subprocess + +file = sys.argv[1] if len(sys.argv) > 1 else input('Filename?') +problem = input('Problem?') +language = input('Language?').lower() + +def get_args(): + if language in ['python', 'py', 'python3', 'py3']: + return ['py', file] + if language in ['java']: + subprocess.run(['javac', file], capture_output=True, text=True, check=True) + if language in ['java', 'class']: + return ['java', '.'.join(file.split('.')[:-1])] + +verdict = 'Something went wrong' +for i in os.listdir('.'): + if i.startswith(str(problem).zfill(2)): + if not os.path.isdir('!LOGS'): + os.mkdir('!LOGS') + for j in os.listdir('!LOGS'): + os.remove(f'!LOGS/{j}') + verdict = 'Verdict: ' + + try: + args = get_args() + except subprocess.CalledProcessError as e: + verdict = 'C' + with open(f'!LOGS/err.err', 'w') as f: + f.write(e.stderr) + break + if not args: + verdict = 'Something went wrong' + break + for j in range(10): + with open(f'{i}/{j}.txt') as f: + process = subprocess.run(['python3', f'{i}/main.py'], capture_output=True, text=True, input=f.read()) + a = [k for k in process.stdout.splitlines() if k] + with open(f'!LOGS/{j}.txt', 'w') as g: + g.write(process.stdout) + f.seek(0) + v = 'W' + process = None + try: + process = subprocess.run(args, capture_output=True, text=True, input=f.read(), timeout=10, check=True) + except subprocess.TimeoutExpired as e: + v = 'T' + process = e + except subprocess.CalledProcessError as e: + v = 'E' + process = e + b = [k for k in (process.stdout or '').splitlines() if k] + with open(f'!LOGS/{j}.out', 'w') as g: + g.write(process.stdout or '') + with open(f'!LOGS/{j}.err', 'w') as g: + g.write(process.stderr or '') + if a == b: + v = 'A' + verdict += v + break +print(verdict) +input() \ No newline at end of file