백준2319 [백준/파이썬] 15779번 Zigzag -Coden = int(input())nums = list(map(int, input().split()))max_cnt, cnt = 0, 2for i in range(n - 2): if nums[i] = nums[i + 1] >= nums[i + 2]: cnt = 2 else: cnt += 1 max_cnt = max(max_cnt, cnt)print(max_cnt) 2024. 8. 17. [백준/파이썬] 28635번 Индикатор -Codem = int(input())a = int(input())b = int(input())if a > b: print(b + m - a)else: print(b - a) 2024. 8. 16. [백준/파이썬] 26516번 Mutint -Codewhile True: n = list(map(int, input())) if n[0] == 0: break max_n = max(n) max_p = n.index(max_n) if max_n % 2 == 1: n[max_p] = 0 else: max_n += 4 if max_n > 9: string_max = str(max_n) max_n = int(string_max[1]) n[max_p] = max_n print(int("".join(map(str, n)))) 2024. 8. 15. [백준/파이썬] 6930번 Mod Inverse -Codex = int(input())m = int(input())for i in range(1, 100001): if (m * i + 1) % x == 0: print((m * i + 1) // x) break i += 1else: print("No such integer exists.") 2024. 8. 14. [백준/파이썬] 17869번 Simple Collatz Sequence -Coden = int(input())res = 0while n > 1: if n % 2 == 0: n //= 2 else: n += 1 res += 1print(res) 2024. 8. 13. [백준/파이썬] 11809번 YODA -Codedef solution(string): return int(string) if string != '' else "YODA"n1 = list(input().strip())n2 = list(input().strip())for i in range(min(len(n1), len(n2))): p = -i -1 if int(n1[p]) > int(n2[p]): n2[p] = '' elif int(n1[p]) 2024. 8. 12. 이전 1 ··· 22 23 24 25 26 27 28 ··· 387 다음