본문 바로가기
ALGOSPOT BOARDCOVER: 게임판 덮기 Link : algospot.com/judge/problem/read/BOARDCOVER Python 더보기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 from sys import stdin # 각 사진의 순서대로 좌표를 입력해준 것 coverType = [[(0, 0), (1, 0), (0, 1)], [(0, 0), (0, 1), (1, 1)], [(0, 0), (1, 0), (1, 1)], [(0, 0), (1, 0), (1, -1)]] def set_cov.. 2021. 2. 20.
PROGRAMMERS 64062: 징검다리 건너기 Link : programmers.co.kr/learn/courses/30/lessons/64062 Python (성공 소스) 더보기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 def calcZero(arr, m): max_zero = 0 zero = 0 for i in range(len(arr)): if arr[i] - m max_zero: max_zero = zero else: zero = 0 return max_zero def solution(stones, k): s = min(stones) e = max(stones) while s = k: e = m elif zero_cnt 2021. 1. 25.
PROGRAMMERS 60059: 자물쇠와 열쇠 Link : programmers.co.kr/learn/courses/30/lessons/60059 Python 더보기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 import copy def rotation(shape): ''' :param location: (위치 좌표) :return: 시계방향 90도 회전 ''' n = len(shape) m = len(shape[0]) result = [[0] * n for _ in range(m)] for i in range(n): for j in range(m): result[j][.. 2021. 1. 25.
KOREATECH 1074: 유일한 수 두개 Link : judge.koreatech.ac.kr/problem.php?id=1074 Python 더보기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 from sys import stdin testcase = int(stdin.readline().strip()) while testcase: stack = [] data_length = int(stdin.readline().strip()) data = [int(i) for i in stdin.readline().strip().split(' ')] data.sort() for i in data: if len(stack) == 0: stack.append(i) else: if stack[-1] == i: stac.. 2021. 1. 23.
KOREATECH 1046: 빠른 길 찾기 Link : judge.koreatech.ac.kr/problem.php?id=1046 Python 더보기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 from sys import stdin import queue data = [] def able_move(x, y): if x = map_y: return False if map_data[y][x] == '-' or map_data[y][x] == 'E' or map_data[y][x] == 'S': return True else: r.. 2021. 1. 22.