Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- text-to-speech
- korean tts
- deep voice
- 음성 합성
- 한국어 tts
- 딥러닝
- 노래합성
- DCTTS
- Vocoder
- 딥러닝 음성 합성
- 윈도우
- 학습
- 보코더
- 타코트론
- YOLO
- 딥러닝 보코더
- singing voice synthesis
- tacotron
- 트레이닝
- waveglow
- 한국어 음성 합성
- melgan
- you only look once
- TTS
Archives
- Today
- Total
chldkato
백준 14889 스타트와 링크 (파이썬) 본문
https://www.acmicpc.net/problem/14889
1. dfs 조합으로 n / 2 명의 사람을 선택해 팀을 나눈다
2. select에 저장된 수가 0 혹은 1인지에 따라 팀을 구분할 수 있다
이에 맞춰서 스타트팀과 링크팀의 능력치를 구한다
3. 능력치의 차이값 중 최소값을 출력한다
import sys
input = sys.stdin.readline
def dfs(idx, cnt):
global ans
if cnt == n // 2:
start, link = 0, 0
for i in range(n):
for j in range(n):
if select[i] and select[j]:
start += a[i][j]
elif not select[i] and not select[j]:
link += a[i][j]
ans = min(ans, abs(start - link))
for i in range(idx, n):
if select[i]:
continue
select[i] = 1
dfs(i + 1, cnt + 1)
select[i] = 0
n = int(input())
a = [list(map(int, input().split())) for _ in range(n)]
select = [0 for _ in range(n)]
ans = sys.maxsize
dfs(0, 0)
print(ans)
'백준' 카테고리의 다른 글
백준 14503 로봇 청소기 (파이썬) (0) | 2020.04.17 |
---|---|
백준 14888 연산자 끼워넣기 (파이썬) (0) | 2020.04.17 |
백준 14890 경사로 (파이썬) (0) | 2020.04.16 |
백준 14891 톱니바퀴 (파이썬) (0) | 2020.04.16 |
백준 15683 감시 (파이썬) (0) | 2020.04.16 |
Comments