mirror of
https://github.com/Xevion/contest.git
synced 2025-12-10 04:06:53 -06:00
problem 4
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
C793A
|
||||
B83B5
|
||||
4ABAC
|
||||
@@ -0,0 +1,24 @@
|
||||
import sys, os
|
||||
|
||||
def evaluate(patterns, a, b, c):
|
||||
mapping = str.maketrans('ABC', str(a) + str(b) + str(c))
|
||||
x, y, z = patterns[0].translate(mapping), patterns[1].translate(mapping), patterns[2].translate(mapping)
|
||||
x, y, z = int(x), int(y), int(z)
|
||||
if x + y == z:
|
||||
return [x, y, z]
|
||||
|
||||
def main():
|
||||
# Read Input Data
|
||||
path = os.path.join(sys.path[0], 'input')
|
||||
data = open(path, 'r').read().split('\n')
|
||||
|
||||
# Just cycle through all iterations until one is found.
|
||||
for x in range(10):
|
||||
for y in range(10):
|
||||
for z in range(10):
|
||||
result = evaluate(data, x, y, z)
|
||||
if result:
|
||||
return result
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(main())
|
||||
@@ -0,0 +1,5 @@
|
||||
# 1991 YSU-ACM High School Programming Contest
|
||||
|
||||
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)
|
||||
BIN
berkely/1991 YSU-ACM High School Programming Contest/ysu_91.pdf
Normal file
BIN
berkely/1991 YSU-ACM High School Programming Contest/ysu_91.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user