본문 바로가기
KOREATECH 1057: 걸기 쉬운 전화번호 Link : judge.koreatech.ac.kr/problem.php?id=1057 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 from sys import stdin num = dict() num[1] = [2, 4] num[2] = [1, 3, 5] num[3] = [2, 6] num[4] = [1, 5, 7] num[5] = [2, 4, 6, 8] num[6] = [3, 5, 9] num[7] = [4, 8] num[8] = [5, 7, 9, 0] num[9] = [6, 8] num[0] = [8] dp = [[0.. 2020. 12. 11.
KOREATECH 1056: 화장실 타일 채우기 Link : judge.koreatech.ac.kr/problem.php?id=1056 Python 더보기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 from sys import stdin testcase = int(stdin.readline().strip()) while testcase: length = int(stdin.readline().strip()) dp = [0] * 101 dp[1] = 1 dp[2] = 2 for i in range(3, length+1): dp[i] = ((dp[i - 1]) + dp[i - 2]) % 1000000007 print(dp[length]) testcase -= 1 Colored by Color Scripter cs FeedBack .. 2020. 12. 11.
KOREATECH 1055: 판채우기 Link : judge.koreatech.ac.kr/problem.php?id=1055 Python 더보기 1 2 3 4 5 6 7 8 9 10 11 12 x = int(input()) for i in range(x): n = int(input()) d = [0] * 101 d[1] = 1 d[2] = 3 for i in range(3, n+1): d[i] = (d[i-1] + 2 * d[i-2]) % 1000000007 print(d[n]) Colored by Color Scripter cs FeedBack cjw.git@gmail.com 2020. 12. 11.
KOREATECH 1047: 몇 가지 음악을 듣고 있을까 Link : judge.koreatech.ac.kr/problem.php?id=1047 Python 더보기 1 2 3 4 5 6 7 8 9 10 from sys import stdin dp = dict() case_cnt = int(stdin.readline().strip()) for _ in range(case_cnt): data = int(stdin.readline().strip()) dp[data] = 0 print(len(dp)) cs FeedBack cjw.git@gmail.com 2020. 12. 11.
KOREATECH 1035: 최소 이동거리 Link : judge.koreatech.ac.kr/problem.php?id=1035 Python 더보기 1 2 3 4 5 6 7 8 9 10 11 from sys import stdin data_length = int(stdin.readline().strip()) arr = list(map(int, stdin.readline().strip().split())) i = data_length // 2 sum = 0 for j in arr: sum += abs(j - arr[i]) print(sum) Colored by Color Scripter cs FeedBack cjw.git@gmail.com 2020. 12. 11.