mirror of
https://github.com/Xevion/contest.git
synced 2025-12-15 06:11:26 -06:00
ysu-acm solves and icpc A & B
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
90 80 4
|
||||
60 35 25
|
||||
50 140 35
|
||||
195 165 25
|
||||
195 40 40
|
||||
@@ -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()
|
||||
@@ -0,0 +1 @@
|
||||
24
|
||||
@@ -0,0 +1 @@
|
||||
25
|
||||
@@ -0,0 +1 @@
|
||||
987654321
|
||||
@@ -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()
|
||||
@@ -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**
|
||||
Binary file not shown.
Reference in New Issue
Block a user