diff --git a/190527/nailer/supoja.py b/190527/nailer/supoja.py new file mode 100644 index 0000000..4da95b0 --- /dev/null +++ b/190527/nailer/supoja.py @@ -0,0 +1,31 @@ +def solution(answers): + answer = [] + x = 0 + y = 0 + z = 0 + d = {} + ySet = [2, 1, 2, 3, 2, 4, 2, 5] + zSet = [3, 3, 1, 1, 2, 2, 4, 4, 5, 5] + for i in list(range(len(answers))): + if answers[i] == i % 5 + 1: + x += 1 + if answers[i] == ySet[i % 8]: + y += 1 + if answers[i] == zSet[i % 10]: + z += 1 + if x==y and y==z: + return [1,2,3] + if x>y and x>z: + return [1] + if y>x and y>z: + return [2] + if z>x and z>y: + return [3] + if x==y and y > z: + return [1, 2] + if y==z and z > x: + return [2, 3] + if z==x and x > y: + return [1, 3] + + return answer diff --git a/190530/nailer/snail.py b/190530/nailer/snail.py new file mode 100644 index 0000000..24e3901 --- /dev/null +++ b/190530/nailer/snail.py @@ -0,0 +1,32 @@ +import sys +from functools import reduce + +a = int(input()) +b = int(input()) +matrix = [[0]*a for i in range(a)] +row = a//2 +column = a//2 +sequence = 1 +sequenceCount = 0 +posiNeg = -1 +answerRow = 0 +answerCol = 0 + +for i in range(a*a): + matrix[row][column] = i+1 + if b == i+1: + answerRow = row + answerCol = column + if sequenceCount == 2*sequence: + sequence += 1 + sequenceCount = 0 + posiNeg *= -1 + sequenceCount += 1 + if sequenceCount <= sequence: + row += posiNeg + else: + column += posiNeg * -1 + +for item in matrix: + print(reduce(lambda x, y: str(x)+' '+str(y), item)) +print(answerRow+1, answerCol+1)