일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- bootstrap
- MongoDB
- 파이썬
- raspberrypi
- 2909
- 16.04
- NAV
- 알고리즘
- 트리
- 백준
- CSS
- dynaminprogramming
- 라즈베리파이3
- node.js
- 크롤링
- 라즈베리파이3b+
- baekjun
- 라즈베리파이
- 13237
- springboot3.x
- 2579
- nav-tab
- Crawling
- ubuntu
- algotythm
- Algorythm
- Python
- 라즈비안
- dp
- HTML
- Today
- Total
목록분류 전체보기 (49)
노트
n,m = map(int,input().split()) cards = list(map(int,input().split())) ans = 0 for i in range(m): cards.sort() temp = cards[0]+cards[1] cards[0] = cards[1] = temp for j in range(n): ans += cards[j] print(ans)
import sys import heapq input = sys.stdin.readline V, E = map(int, input().split()) visited = [False]*(V+1) Elist = [[] for _ in range(V+1)] heap = [[0, 1]] for _ in range(E): s, e, w = map(int, input().split()) Elist[s].append([w, e]) Elist[e].append([w, s]) answer = 0 cnt = 0 while heap: if cnt == V: break w, s = heapq.heappop(heap) if not visited[s]: visited[s] = True answer += w cnt += 1 for..
@EnableSwagger2가 적용되지 않아서 구글링한 결과 gradle implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0' maven org.springdoc springdoc-openapi-starter-webmvc-ui 2.1.0 이렇게 쓰면 된다고 한다. SwaggerConfig를 작성하지 않아도 동작한다. 주소는 http://localhost:8080/swagger-ui/index.html 이다.
n = int(input()) for i in range(n): floor = int(input()) room = int(input()) f0 = [i for i in range(1,room+1)] for j in range(floor): for k in range(1,room): f0[k] += f0[k - 1] print(f0[room-1])
from collections import deque def bfs(node): queue = deque() queue.append(node) while queue: node = queue.popleft() for n in friend[node]: if check[n] == 0: check[n] = check[node]+1 queue.append(n) n = int(input()) m = int(input()) friend = [[] for _ in range(n+1)] for j in range(m): a,b=map(int,input().split(' ')) friend[a].append(b) friend[b].append(a) check = [0]*(n+1) check[1] = 1 bfs(1) res..
n = int(input()) answer = 0 in_, out = dict(), [] for i in range(n): car = input() in_[car] = i for _ in range(n): car = input() out.append(car) for i in range(n - 1): for j in range(i + 1, n): if in_[out[i]] > in_[out[j]]: answer += 1 break print(answer)
3번이나 틀렸다고 나와서 뭐지 했는데 아이패드로 풀어서 예제 복사할때 줄바꿈이 안됐던거였다.. 데탑으로 푸니 잘됨 q = [] while True: s = input() if s=='.': break for i in range(len(s)): if s[i] == '.': if len(q) == 0: print('yes') else: print('no') q = [] continue if s[i] == '(' or s[i] == ')' or s[i] == '[' or s[i] == ']': q.append(s[i]) if len(q) > 0: if s[i] == ')' and q[len(q) - 2] == '(': q.pop() q.pop() if s[i] == ']' and q[len(q) - 2] ==..
v = int(input()) e = int(input()) graph = [[] for _ in range(v+1)] for _ in range(e): a, b = map(int, input().split()) graph[a].append(b) graph[b].append(a) def dfs(x): global count visited[x] = True count += 1 for node in graph[x]: if visited[node]: continue dfs(node) count = 0 visited = [False for _ in range(v+1)] dfs(1) print(count-1)