본문 바로가기
KOREATECH 1100: 눈이 침침한 재성이 Link : judge.koreatech.ac.kr/problem.php?id=1100 Python 더보기 1 2 3 4 5 6 7 8 9 10 11 from sys import stdin temp = stdin.readline().strip().split(' ') n1 = temp[0] n2 = temp[1] max = int(n1.replace('5', '6')) + int(n2.replace('5', '6')) min = int(n1.replace('6', '5')) + int(n2.replace('6', '5')) print(min, max) Colored by Color Scripter cs FeedBack cjw.git@gmail.com 2020. 12. 14.
KOREATECH 1098: 첫 유일 문자 찾기 Link : judge.koreatech.ac.kr/problem.php?id=1098 Python 더보기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 from sys import stdin quest_cnt = int(stdin.readline().strip()) for _ in range(quest_cnt): data = dict() data_arr = stdin.readline().strip() for idx, s in enumerate(data_arr): if s not in data: data[s] = [1, idx] else: data[s][0] += 1 if len(data) == 0: print('-1') else: for idx, key.. 2020. 12. 14.
KOREATECH 1097: 실습시험 연습문제: 가장 긴 접두부분문자열 찾기 Link : judge.koreatech.ac.kr/problem.php?id=1097 Python 더보기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 from sys import stdin case_cnt = int(stdin.readline().strip()) for _ in range(case_cnt): data_list = stdin.readline().strip().split(' ') token = '' status = True try: for idx, target in enumerate(data_list[1]): for i in range(2, len(data_list)): if target != data_list[i][idx]: .. 2020. 12. 14.
KOREATECH 1071: 암호 해석 - 오고고 Link : judge.koreatech.ac.kr/problem.php?id=1071 Python 더보기 12345678910111213141516171819202122232425from sys import stdin data_length = int(stdin.readline().strip()) data_arr = stdin.readline().strip() while True: str_idx = data_arr.find("ogo") if str_idx == -1: break next_pos = 0 for i in range(str_idx, len(data_arr) - 1, 2): if i + 3 2020. 12. 11.
KOREATECH 1063: 계단 오르기 Link : judge.koreatech.ac.kr/problem.php?id=1063 Python 더보기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 from sys import stdin testcase = int(stdin.readline().strip()) while testcase: data = int(stdin.readline().strip()) if data == 1: print(1) elif data == 2: print(2) else: dp = [0] * data dp[0] = 1 dp[1] = 2 for i in range(2, data): dp[i] = dp[i-1] + dp[i-2] print(dp[-1]) testcase-=1 cs F.. 2020. 12. 11.