KOREATECH 1030: 한번 주식 거래하기 Link : judge.koreatech.ac.kr/problem.php?id=1030 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 from sys import stdin testcase = int(stdin.readline().strip()) - 1 data = int(stdin.readline().strip()) min_value = data max_value = data result = 0 while testcase: data = int(stdin.readline().strip()) if data max_value: max_value = data if max_value - min_value > resu.. 2020. 12. 10. KOREATECH 1027: 인접한 문자 제거하기 HARD Link : judge.koreatech.ac.kr/problem.php?id=1027 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 from sys import stdin def solution(s): stack = [] for idx, char in enumerate(s): if len(stack) 2020. 12. 10. KOREATECH 1025: 단색이 좋아좋아 Link : judge.koreatech.ac.kr/problem.php?id=1025 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 quest_cnt = int(stdin.readline().strip()) for _ in range(quest_cnt): data = stdin.readline().strip() length = len(data) pres = 1 max = 0 if length != 1: for i in range(1, length): if data[i] == data[i - 1]: pres += 1 else: if pres > max: max = pres pres = .. 2020. 12. 10. KOREATECH 1021: 연속된 최장 길이 Link : judge.koreatech.ac.kr/problem.php?id=1021 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 from sys import stdin quest_cnt = int(stdin.readline().strip()) for i in range(quest_cnt): arrlist = [int(data) for data in stdin.readline().strip().split(' ')] data_length = arrlist[0] if data_length == 0: print('0') continue arrlist = arrlist[1:len(arrlist)] max_length = 0.. 2020. 12. 10. KOREATECH 1019: 숫자 바꿔치기 Link : judge.koreatech.ac.kr/problem.php?id=1019 Python 더보기 12345678910111213141516171819202122232425from sys import stdin def makeNumber(body, a, b): temp = body[:] temp[a], temp[b] = temp[b], temp[a] return int(''.join(temp)) quest_cnt = int(stdin.readline().strip()) for i in range(quest_cnt): price = [i for i in stdin.readline().strip()] low_price = 0; high_price = 0 price_list = [] length = .. 2020. 12. 10. 이전 1 ··· 12 13 14 15 16 17 다음