mirror of
https://github.com/Xevion/contest.git
synced 2025-12-10 16:06:50 -06:00
update .gitignore, remove .vscode and .idea folders, move berkely to ysu-acm
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
5
|
||||
2
|
||||
3
|
||||
1
|
||||
2
|
||||
@@ -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))
|
||||
@@ -0,0 +1,2 @@
|
||||
5
|
||||
100
|
||||
@@ -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))
|
||||
23
ysu-acm/1991 YSU-ACM High School Programming Contest/3/input
Normal file
23
ysu-acm/1991 YSU-ACM High School Programming Contest/3/input
Normal file
@@ -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
|
||||
@@ -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 @@
|
||||
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?
|
||||
@@ -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)
|
||||
@@ -0,0 +1,21 @@
|
||||
# 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)
|
||||
|
||||
## Notice
|
||||
|
||||
Inputs / Outputs are retyped since the PDF is obsfucated.
|
||||
|
||||
## Progress
|
||||
|
||||
#1 : Solved
|
||||
|
||||
#2 : **Unsolved**
|
||||
|
||||
#3 : **Unsolved**
|
||||
|
||||
#4 : Solved
|
||||
|
||||
#5 : **Unsolved**
|
||||
BIN
ysu-acm/1991 YSU-ACM High School Programming Contest/ysu_91.pdf
Normal file
BIN
ysu-acm/1991 YSU-ACM High School Programming Contest/ysu_91.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user