본문 바로가기

Beakjoon&프로그래머스/파이썬2293

[백준/파이썬] 33869번 일기 암호화하기 -Codew = input()s = input()security = ""alpa = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"res = ""# 암호화 키 생성for ch in w: if ch not in security: security += chfor ch in alpa: if ch not in w: security += ch# 암호화for ch in s: res += security[ord(ch) - 65]print(res) 2025. 5. 24.
[백준/파이썬] 33909번 알파벳 블록 -Codes, c, o, n = map(int, input().split())c += o * 2n += sprint(min(n // 3, c // 6)) 2025. 5. 23.
[백준/파이썬] 33868번 스티커 나눠주기 -Codemax_t, min_l = 0, 1e9for _ in range(int(input())): t, b = map(int, input().split()) max_t = max(max_t, t) min_l = min(min_l, b)print(max_t * min_l % 7 + 1) 2025. 5. 21.
[백준/파이썬] 33964번 레퓨닛의 덧셈 -Codex, y = map(int, input().split())print(int('1' * x) + int('1' * y)) 2025. 5. 20.
[백준/파이썬] 33883번 Acentuación del idioma español -Codevowels = ["a", "e", "i", "o", "u"]ns = ["n", "s"]s = input()res = -1if s[-1] not in vowels and s[-1] not in ns: for i in range(len(s) - 1, -1, -1): if s[i] in vowels: res = i + 1 breakelse: cnt = 0 for i in range(len(s) - 1, -1, -1): if s[i] in vowels: cnt += 1 if cnt == 2: res = i + 1 breakprint(res) 2025. 5. 18.
[백준/파이썬] 27891번 특별한 학교 이름 암호화 -Codenames = { "NLCS": "northlondo", "BHA" : "branksomeh", "KIS" : "koreainter", "SJA" : "stjohnsbur" }alpa = "abcdefghijklmnopqrstuvwxyz"line = input()res = ""for k, v in names.items(): for i in range(26): temp = "" for ch in v: change_ch = ord(ch) + i temp += alpa[change_ch % 26] if temp == line: .. 2025. 5. 17.