2024/05/15 3

[Python][SWEA] 4751. 다솔이의 다이아몬드 장식 D3

SW Expert AcademySW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!swexpertacademy.com 🗒️ 파이썬 코드 풀이T = int(input())for tc in range(1,T+1): dasol = list(input()) lst = [["."] * 5 for _ in range(5)] # 다이아 몬드 형태로 바꿔주기 shap = [(0,2),(1,1),(1,3),(2,0),(2,4),(3,1),(3,3),(4,2)] for i,j in shap: lst[i][j] = "#" chaged_lst = [lst[i].copy() for i in range(5)] # 얕은 복사 # 기존 리스트 변형 (맨 뒤 요..

[Python][SWEA] 9480. 민정이와 광직이의 알파벳 공부 D3

SW Expert AcademySW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!swexpertacademy.com 🗒️ 파이썬 코드 풀이def Alphabet_combination(n,lst_union): global ans if n == N : if lst_union == alphabet: ans+=1 return Alphabet_combination(n+1,lst_union|set(lst[n])) Alphabet_combination(n+1,lst_union)T = int(input())for tc in range(1,T+1): N = int(input()) lst = [set(input().str..

[Python][SWEA] 14413. 격자판 칠하기 D3

SW Expert AcademySW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!swexpertacademy.com 🗒️ 파이썬 코드 풀이def grid(type1,type2) : for i in range(N): for j in range(M) : if lst[i][j] == '?' : continue # "?"인 값은 제외 if (i+j)%2 == 0 : # i+j가 짝수인 경우 if lst[i][j] != type1: # 각 case와 일치하지 않는 경우 return False else : if lst[i][j]..