KOREATECH 1125: 좌우로 밀착 I Link : judge.koreatech.ac.kr/problem.php?id=1125 C++ 더보기 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 43 44 45 46 47 48 49 50 51 52 53 54 #include #include #include using namespace std; int main() { int testcase = 0; cin >> testcase; while (testcase--) { int x, y, n; cin >> y >> x; vector v(y, vector(0)); for (int i = 0; i n.. 2020. 12. 16. KOREATECH 1119: 제스쳐 컨트롤 II Link : judge.koreatech.ac.kr/problem.php?id=1119 Python 더보기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 from sys import stdin case_cnt = int(stdin.readline().strip()) for _ in range(case_cnt): data = stdin.readline().strip().split(' ') pos = 0 for s in data[1]: if s == 'L': pos += 1 elif s == 'R': pos -= 1 for i in range(len(data[0])): print(data[0][(i + pos) % len(data[0])], end='') print() Colored .. 2020. 12. 16. KOREATECH 1116: 짝궁 문자열 Link : judge.koreatech.ac.kr/problem.php?id=1116 Python 더보기 1234567891011121314151617181920212223242526from sys import stdin testcase = int(stdin.readline().strip()) while testcase: x, y = list(map(str, stdin.readline().strip().split())) stack = [] if len(x) == len(y): for idx in range(len(x)): if x[idx] != y[idx]: stack.append((x[idx], y[idx])) if len(stack) == 0: print('yes') elif len(stack) =.. 2020. 12. 15. KOREATECH 1110: 징검다리 Link : judge.koreatech.ac.kr/problem.php?id=1110 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 data_length = int(stdin.readline().strip()) arr = list(map(int, stdin.readline().strip().split(' '))) pos = 0 while True: if pos >= data_length or pos + arr[pos] >= data_length: print('Yes') break max = 0 pres = 0 for i in range(1, arr[pos] + 1): if arr[po.. 2020. 12. 15. KOREATECH 1109: 자라나라 나무나무 Link : judge.koreatech.ac.kr/problem.php?id=1109 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 target = int(stdin.readline().strip()) dp = [0] * 30 dp[0] = 1 for i in range(1, 30): dp[i] = dp[i - 1] * 2 info = [] cut_day = 0 for i in range(29, -1, -1): if target == 0: break if target >= dp[i]: target -= dp[i] info.append(i + 1) if cut_day == 0: c.. 2020. 12. 14. 이전 1 ··· 9 10 11 12 13 14 15 ··· 17 다음