백준2336 [백준/파이썬] 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. [백준/파이썬] 28062번 준석이의 사탕 사기 -Coden = int(input())candy = list(map(int, input().split()))res = 0odd = []for c in candy: if c % 2 == 0: res += c else: odd.append(c)odd.sort(reverse=True)if len(odd) % 2 == 0: res += sum(odd)else: res += sum(odd[:-1])print(res) 2024. 8. 11. 이전 1 ··· 25 26 27 28 29 30 31 ··· 390 다음