반응형

전체 글 308

[Docker] docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].

docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]. ERRO[0000] error waiting for container: context canceled 문제 상황 Docker를 실행함에 있어 아래와 같은 오류가 발생하였다. docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]. ERRO[0000] error waiting for container: context canceled nvidia-smi를 실행시켜 보았지만, gpus는 정상적으로 잡혀 구글링을 통하여 해..

Development/Docker 2022.05.23

[이코테 2021] 5장 그래프 탐색 알고리즘 [실전문제] 미로 탈출

나의 풀이 n, m = map(int, input().split()) world = [] for _ in range(n): world.append(list(map(int,input()))) from collections import deque dr = [0, -1, 0, 1] dc = [1, 0, -1, 0] def bfs(r, c): q = deque() q.append([r,c]) while q: r, c = q.popleft() for i in range(4): nr = r + dr[i] nc = c + dc[i] if 0 = m: continue # 벽인 경우 무시 if graph[nx][ny] == 0: continue # 해당 노드를 처음 방문하는 경우에만 최단 거리 기록 if graph[nx..

[이코테 2021] 5장 그래프 탐색 알고리즘 [실전문제] 음료수 얼려 먹기

나의 풀이 n, m = map(int, input().split()) world = [] for _ in range(n): world.append(list(map(int, input()))) def dfs(r, c): if r =n or c = m: return False else: if world[r][c] == 0: world[r][c] = 1 dfs(r-1, c) dfs(r+1, c) dfs(r, c-1) dfs(r, c+1) return True else: return False cnt = 0 for r in range(n): for c in range(m): if dfs(r, c): cnt += 1 print(cnt) 답안 예시 # N, M을 공백을 기준으로 ..

[이코테 2021] 4장 구현 [실전문제] 게임 개발

나의 풀이 n, m = map(int, input().split()) a, b, d = map(int, input().split()) world = [] for _ in range(n): world.append(list(map(int, input().split()))) def turn_left(): global d if d == 0: d = 3 else: d -= 1 def visited(): global world world[a][b] = 2 cnt = 1 turn_cnt = 0 left_types = [[0,-1], [-1,0], [0,1], [1,0]] back_types = [[1,0], [0,-1], [-1,0], [0,1]] visited() while True: tmp_a, tmp_b = a..

[이코테 2021] 4장 구현 [실전문제] 왕실의 나이트

나의 풀이 position = input() r = int(position[1]) c = ord(position[0]) - ord('a') + 1 move_types = [[2,1], [2,-1], [-2,1], [-2,-1], [1,2], [-1,2], [1,-2], [-1,-2]] cnt = 0 for m in move_types: tmp_r = r + m[0] tmp_c = c + m[1] if 0 < tmp_r < 9 and 0 < tmp_c < 9: cnt += 1 print(cnt) 답안 예시 # 현재 나이트의 위치 입력받기 input_data = input() row = int(input_data[1]) column = int(ord(input_data[0])) - int(ord('a')) ..

[TensorRT] Keras, Tensorflow Model을 TensorRT로 변환(TF-TRT Inference)

※ 본 글은 아래의 예제을 test하며, 작성한 글입니다. https://github.com/tensorflow/tensorrt/blob/master/tftrt/examples/image_classification/NGC-TFv2-TF-TRT-inference-from-Keras-saved-model.ipynb GitHub - tensorflow/tensorrt: TensorFlow/TensorRT integration TensorFlow/TensorRT integration. Contribute to tensorflow/tensorrt development by creating an account on GitHub. github.com 1. Env. 아래의 Docker를 사용하였습니다. (colab과 ..

[이코테 2021] 3장 그리디 [실전문제] 1이 될 때까지

나의 풀이 n, k = map(int, input().split()) cnt = 0 while n != 1: if n % k == 0: n //= k cnt += 1 else: n -= 1 cnt += 1 print(cnt) 답안 예시 # N, K을 공백을 기준으로 구분하여 입력 받기 n, k = map(int, input().split()) result = 0 // N이 K 이상이라면 K로 계속 나누기 while n >= k: # N이 K로 나누어 떨어지지 않는다면 N에서 1씩 빼기 while n % k != 0: n -= 1 result += 1 # K로 나누기 n //= k result += 1 # 마지막으로 남은 수에 대하여 1씩 빼기 while n > 1: n -= 1 result += 1 pr..

[이코테 2021] 3장 그리디 [실전문제] 숫자 카드 게임

나의풀이 n, m = map(int, input().split()) arr = [] min_arr = [] for _ in range(n): tmp = list(map(int, input().split())) min_arr.append(min(tmp)) arr.append(tmp) print(max(min_arr)) 답안 예시 # N, M을 공백을 기준으로 구분하여 입력 받기 n, m = map(int, input().split()) result = 0 # 한 줄씩 입력 받아 확인하기 for i in range(n): data = list(map(int, input().split())) # 현재 줄에서 '가장 작은 수' 찾기 min_value = min(data) # '가장 작은 수'들 중에서 가장 큰 ..

[이코테 2021] 3장 그리디 [실전문제] 큰 수의 법칙

나의 풀이 n, m, k = map(int, input().split()) arr = list(map(int, input().split())) arr.sort(reverse=True) num = m // (k+1) result = (arr[0]*k + arr[1])*num + arr[0]*(m%(k+1)) print(result) 답안 예시 # N, M, K를 공백을 기준으로 구분하여 입력 받기 n, m, k = map(int, input().split()) # N개의 수를 공백을 기준으로 구분하여 입력 받기 data = list(map(int, input().split())) data.sort() # 입력 받은 수들 정렬하기 first = data[n - 1] # 가장 큰 수 second = data[..

[이코테 2021] 3장 그리디 [예제 3-1] 거스름돈

나의 풀이 n = int(input()) coins = [500, 100, 50, 10] count = 0 for c in coins: if n//c > 0: count += n//c n = n%c print(count) # / : 나누기 # // : 몫 # % : 나머지 답안 예시 n = 1260 count = 0 # 큰 단위의 화폐부터 차례대로 확인하기 coin_types = [500, 100, 50, 10] for coin in coin_types: count += n // coin # 해당 화폐로 거슬러 줄 수 있는 동전의 개수 세기 n %= coin print(count)

[Stanford University School of Engineering] Convolutional Neural Networks for Visual Recognition (Spring 2017)

https://youtube.com/playlist?list=PL3FW7Lu3i5JvHM8ljYj-zLfQRF3EO8sYv Lecture Collection | Convolutional Neural Networks for Visual Recognition (Spring 2017) Computer Vision has become ubiquitous in our society, with applications in search, image understanding, apps, mapping, medicine, drones, and self-driving car... www.youtube.com Convolutional Neural Networks for Visual Recognition (Spring 201..

[점프투파이썬] 04장 프로그램의 입력과 출력은 어떻게 해야 할까?

https://wikidocs.net/23 04장 프로그램의 입력과 출력은 어떻게 해야 할까? 지금껏 공부한 내용을 바탕으로 함수, 입력과 출력, 파일 처리 방법 등에 대해서 알아보기로 하자. 입출력은 프로그래밍 설계와 관련이 있다. 프로그래머는 프로그램을 만들기 ... wikidocs.net 04-1 함수 함수란 무엇인가? 함수를 사용하는 이유는 무엇일까? 파이썬 함수의 구조 매개변수와 인수 입력값과 결괏값에 따른 함수의 형태 일반적인 함수 입력값이 없는 함수 결괏값이 없는 함수 입력값도 결괏값도 없는 함수 매개변수 지정하여 호출하기 입력값이 몇 개가 될지 모를 때는 어떻게 해야 할까? 함수의 결괏값은 언제나 하나이다 매개변수에 초깃값 미리 설정하기 함수 안에서 선언한 변수의 효력 범위 함수 안에서 함..

Development/Python 2022.04.12
반응형