[BOJ] 백준 14889 스타트와링크 자바 (Java) 파이썬 (Python)
2022. 8. 23. 14:34
알고리즘/백준[BaekJoon]
[문제] https://www.acmicpc.net/problem/14889 14889번: 스타트와 링크예제 2의 경우에 (1, 3, 6), (2, 4, 5)로 팀을 나누면 되고, 예제 3의 경우에는 (1, 2, 4, 5), (3, 6, 7, 8)로 팀을 나누면 된다.www.acmicpc.net코드N = int(sys.stdin.readline())S = [list(map(int, sys.stdin.readline().split())) for _ in range(N)]def dfs(step): global mini if len(A) == N >> 1: totalA = totalB = 0 tmp_B = [] for player in all: ..
[BOJ] 백준 19949 영재의 시험 자바 (Java) 파이썬 (Python)
2022. 8. 23. 11:58
알고리즘/백준[BaekJoon]
[문제] https://www.acmicpc.net/problem/19949 19949번: 영재의 시험컴퓨터공학과 학생인 영재는 이번 학기에 알고리즘 수업을 수강한다. 평소에 자신의 실력을 맹신한 영재는 시험 전날까지 공부를 하지 않았다. 당연하게도 문제를 하나도 풀지 못하였지만 다행www.acmicpc.net코드def dfs(s): global cnt if s == 10: point = 0 for j in range(10): if ans[j] == base[j]: point += 1 if point >= 5: cnt += 1 return for i in range(1, 6..