๐ Python
[2941]ํฌ๋ก์ํฐ์ ์ํ๋ฒณ
import sys alp_cro = sys.stdin.readline().rstrip() arr = ['c=', 'c-', 'dz=', 'd-', 'lj', 'nj', 's=', 'z='] for alp in arr: if alp in alp_cro: alp_cro = alp_cro.replace(alp, '*') print(len(alp_cro)) 2941 ํฌ๋ก์ํฐ์ ์ํ๋ฒณ
[5622]๋ค์ด์ผ
import sys alp_arr = sys.stdin.readline().rstrip() time_tot = 0 for alp in alp_arr: if alp in 'ABC': time_tot += 3 elif alp in 'DEF': time_tot += 4 elif alp in 'GHI': time_tot += 5 elif alp in 'JKL': time_tot += 6 elif alp in 'MNO': time_tot += 7 elif alp in 'PQRS': time_tot += 8 elif alp in 'TUV': time_tot += 9 else: time_tot += 10 print(t..
[1157]๋จ์ด ๊ณต๋ถ
import sys import string S = sys.stdin.readline().lower() alpha_ls = string.ascii_lowercase alpha_ct = [] for i in alpha_ls: count = 0 for j in S: if i == j: count += 1 alpha_ct.append(count) max_ls = [i for i in alpha_ct if i == max(alpha_ct)] if len(max_ls) == 1: print(alpha_ls[alpha_ct.index(max(alpha_ct))].upper()) else : print('?') 1157 ๋จ์ด ๊ณต๋ถ words = input().upper() unique_words = l..
[10809]์ํ๋ฒณ ์ฐพ๊ธฐ
import sys import string S = sys.stdin.readline() alpha_str = string.ascii_lowercase for i in alpha_str: if i in S: print(S.index(i), sep=' ') else: print(-1, sep=' ') 10809 ์ํ๋ฒณ ์ฐพ๊ธฐ
[11720]์ซ์์ ํฉ
import sys N = int(sys.stdin.readline()) n = sys.stdin.readline().rstrip() tot = 0 # for i in range(N): # tot += int(n[i]) for i in n: tot += int(i) print(tot) 11720 ์ซ์์ ํฉ for ๋ฌธ์ int๊ฐ์ ๋ฆฌ์คํธ ์ธ๋ฑ์ค์ ๋ฃ๋ ๊ฒ ์ข์ ๋ฐฉ๋ฒ๊ฐ์ง์๋ค. ๊ทผ๋ฐ ๊ทธ๋ ๊ฒ ์ํ์๋ N์ ์ฌ์ฉํ ๊ณณ์ด ์์ด์ง๋ค.