diff --git a/berkely/1991 YSU-ACM High School Programming Contest/1/input b/berkely/1991 YSU-ACM High School Programming Contest/1/input new file mode 100644 index 0000000..2ab281c --- /dev/null +++ b/berkely/1991 YSU-ACM High School Programming Contest/1/input @@ -0,0 +1,5 @@ +5 +2 +3 +1 +2 \ No newline at end of file diff --git a/berkely/1991 YSU-ACM High School Programming Contest/1/main.py b/berkely/1991 YSU-ACM High School Programming Contest/1/main.py new file mode 100644 index 0000000..21ba826 --- /dev/null +++ b/berkely/1991 YSU-ACM High School Programming Contest/1/main.py @@ -0,0 +1,9 @@ +import sys, os + +# Read the data +path = os.path.join(sys.path[0], 'input') +data = open(path, 'r').read().split('\n') +data = list(map(int, data)) +assert all(map(lambda x : x >= 1, data)) + +print('\n\n'.join('\n'.join('*' * x for x in range(n, 0, -1))for n in data)) \ No newline at end of file diff --git a/berkely/1991 YSU-ACM High School Programming Contest/2/input b/berkely/1991 YSU-ACM High School Programming Contest/2/input new file mode 100644 index 0000000..645fe14 --- /dev/null +++ b/berkely/1991 YSU-ACM High School Programming Contest/2/input @@ -0,0 +1,2 @@ +5 +100 \ No newline at end of file diff --git a/berkely/1991 YSU-ACM High School Programming Contest/2/main.py b/berkely/1991 YSU-ACM High School Programming Contest/2/main.py new file mode 100644 index 0000000..cc6b908 --- /dev/null +++ b/berkely/1991 YSU-ACM High School Programming Contest/2/main.py @@ -0,0 +1,16 @@ +import os, sys, math + +path = os.path.join(sys.path[0], 'input') +data = open(path, 'r').read().split('\n') +# To keep with the times of 1991, we will use the constraints of Python2 for max integers +maxInt = 9223372036854775807 + +def extend(n): + res = 1 + for x in range(2, n + 1): + res = x * res + return res + +x = 100 +print(extend(x)) +print(math.log(extend(x), 10)) \ No newline at end of file diff --git a/berkely/1991 YSU-ACM High School Programming Contest/3/input b/berkely/1991 YSU-ACM High School Programming Contest/3/input new file mode 100644 index 0000000..e02bb0c --- /dev/null +++ b/berkely/1991 YSU-ACM High School Programming Contest/3/input @@ -0,0 +1,23 @@ +18 +7 +11 +1 +0 +3 +13 +9 +12 +4 +2 +0 +16 +17 +4 +8 +0 +10 +8 +3 +6 +8 +4 \ No newline at end of file diff --git a/berkely/1991 YSU-ACM High School Programming Contest/5/input b/berkely/1991 YSU-ACM High School Programming Contest/5/input new file mode 100644 index 0000000..8b9f7b4 --- /dev/null +++ b/berkely/1991 YSU-ACM High School Programming Contest/5/input @@ -0,0 +1,5 @@ +THIS IS THE ('FIRST') LINE IN THE SAMPLE FILE!!!! +ANY CHARACTERS CAN BE IN THE FILE%^$*.(")... +('THIS PART OF THE FILE SHOULD NOT BE CHANGED') +'(BUT THIS PART SHOULD 123........('............... +NUMBERS, 1234567890, ARE OK. OK? \ No newline at end of file diff --git a/berkely/1991 YSU-ACM High School Programming Contest/5/main.py b/berkely/1991 YSU-ACM High School Programming Contest/5/main.py new file mode 100644 index 0000000..6b6ccc5 --- /dev/null +++ b/berkely/1991 YSU-ACM High School Programming Contest/5/main.py @@ -0,0 +1,14 @@ +import re, string, os, sys + +pattern = r'([\s\S]*)(\(.*\))([\s\S]*)' +def main(): + path = os.path.join(sys.path[0], 'input') + mapping = str.maketrans(string.ascii_uppercase, string.ascii_uppercase[::-1]) + print(string.ascii_uppercase) + print(string.ascii_uppercase[::-1]) + data = open(path, 'r').read() + matches = re.findall(pattern, data)[0] + result = '' + for match in matches: + result += match if match.startswith('(') else match.translate(mapping) + print(result) \ No newline at end of file diff --git a/berkely/1991 YSU-ACM High School Programming Contest/README.MD b/berkely/1991 YSU-ACM High School Programming Contest/README.MD index 535c510..76d8bbb 100644 --- a/berkely/1991 YSU-ACM High School Programming Contest/README.MD +++ b/berkely/1991 YSU-ACM High School Programming Contest/README.MD @@ -2,4 +2,20 @@ These problems honestly seem extraordinarily easy, but it's likely do to the constraints of computer programming back then. Kind of cheating, using Python. -[Official Link](https://people.eecs.berkeley.edu/~hilfingr/programming-contest/ysu_91.pdf) | [GitHub Mirror](./ysu_91.pdf) \ No newline at end of file +[Official Link](https://people.eecs.berkeley.edu/~hilfingr/programming-contest/ysu_91.pdf) | [GitHub Mirror](./ysu_91.pdf) + +## Notice + +Inputs / Outputs are retyped since the PDF is obsfucated. + +## Progress + +#1 : Solved + +#2 : **Unsolved** + +#3 : **Unsolved** + +#4 : Solved + +#5 : **Unsolved** \ No newline at end of file diff --git a/icpc/2018 ICPC East Central North America Regional Contest/A/input b/icpc/2018 ICPC East Central North America Regional Contest/A/input new file mode 100644 index 0000000..e9187b8 --- /dev/null +++ b/icpc/2018 ICPC East Central North America Regional Contest/A/input @@ -0,0 +1,5 @@ +90 80 4 +60 35 25 +50 140 35 +195 165 25 +195 40 40 \ No newline at end of file diff --git a/icpc/2018 ICPC East Central North America Regional Contest/A/main.py b/icpc/2018 ICPC East Central North America Regional Contest/A/main.py new file mode 100644 index 0000000..69342d9 --- /dev/null +++ b/icpc/2018 ICPC East Central North America Regional Contest/A/main.py @@ -0,0 +1,27 @@ +import sys, os, math + +# Pythagorean Distance Formula +def pyth(x1, y1, x2, y2): + return math.sqrt(((x1 - x2) ** 2) + ((y1 - y2) ** 2)) + +def dist(spot1, spot2): + return pyth(spot1[0], spot1[1], spot2[0], spot2[1]) + +def main(): + def parse(dat): + return list(map(int, dat.split())) + + + path = os.path.join(sys.path[0], 'input') + data = open(path, 'r').read().split('\n') + listeners = [] + + + for dataset in data: + listeners.append(parse(dataset)) + spy = listeners.pop(0) + + distances = sorted() + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/icpc/2018 ICPC East Central North America Regional Contest/B/inputs/1 b/icpc/2018 ICPC East Central North America Regional Contest/B/inputs/1 new file mode 100644 index 0000000..cabf43b --- /dev/null +++ b/icpc/2018 ICPC East Central North America Regional Contest/B/inputs/1 @@ -0,0 +1 @@ +24 \ No newline at end of file diff --git a/icpc/2018 ICPC East Central North America Regional Contest/B/inputs/2 b/icpc/2018 ICPC East Central North America Regional Contest/B/inputs/2 new file mode 100644 index 0000000..410b14d --- /dev/null +++ b/icpc/2018 ICPC East Central North America Regional Contest/B/inputs/2 @@ -0,0 +1 @@ +25 \ No newline at end of file diff --git a/icpc/2018 ICPC East Central North America Regional Contest/B/inputs/3 b/icpc/2018 ICPC East Central North America Regional Contest/B/inputs/3 new file mode 100644 index 0000000..0eee334 --- /dev/null +++ b/icpc/2018 ICPC East Central North America Regional Contest/B/inputs/3 @@ -0,0 +1 @@ +987654321 \ No newline at end of file diff --git a/icpc/2018 ICPC East Central North America Regional Contest/B/main.py b/icpc/2018 ICPC East Central North America Regional Contest/B/main.py new file mode 100644 index 0000000..1d95c3c --- /dev/null +++ b/icpc/2018 ICPC East Central North America Regional Contest/B/main.py @@ -0,0 +1,17 @@ +import os, sys + +def harshad(n): + return (n % sum(map(int, list(str(n))))) == 0 + +def main(): + inputs = [os.path.join(sys.path[0], 'inputs', x) for x in + os.listdir(os.path.join(sys.path[0], 'inputs'))] + inputs = [int(open(path).read()) for path in inputs] + + for i in inputs: + while not harshad(i): + i += 1 + print(i) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/icpc/2018 ICPC East Central North America Regional Contest/README.MD b/icpc/2018 ICPC East Central North America Regional Contest/README.MD new file mode 100644 index 0000000..e9c5add --- /dev/null +++ b/icpc/2018 ICPC East Central North America Regional Contest/README.MD @@ -0,0 +1,13 @@ +# 2018 ICPC East Central North America Regional Contest + +[Report](http://acm-ecna.ysu.edu/PastResults/2018/home.html) | [] + +## Notice + +Most of these problems seem modestly easy, if I'm being honest. + +## Progress + +#1 : Unsovled + +#2 : **Solved** \ No newline at end of file diff --git a/icpc/2018 ICPC East Central North America Regional Contest/prac2018.pdf b/icpc/2018 ICPC East Central North America Regional Contest/prac2018.pdf new file mode 100644 index 0000000..272e321 Binary files /dev/null and b/icpc/2018 ICPC East Central North America Regional Contest/prac2018.pdf differ