1926
-
[Python] 1926: 간단한 369게임코딩테스트/SWEA 2024. 11. 14. 09:58
https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=2&problemLevel=3&contestProbId=AV5PTeo6AHUDFAUq&categoryId=AV5PTeo6AHUDFAUq&categoryType=CODE&problemTitle=&orderBy=INQUERY_COUNT&selectCodeLang=PYTHON&select-1=3&pageSize=10&pageIndex=1요구사항Python 4초10 메모리 256게임 규칙에 맞게 출력하는 프로그램을 작성하라설계3 or 6 or 9의 개수를 count 해서 상황에 맞게 출력해주자. 구현n = int(input())for i in range(1, n + 1): ..
-
[Python] BOJ 1926 : 그림코딩테스트/백준 2024. 10. 29. 07:58
요구사항, 설계2차원 배열의 최대 크기가 2500이다. 시간 메모리 걱정 없다.5분 생각하고 안 떠올라서 답지 봤다.구현from collections import deque# 가로 세로 크기n, m = map(int, input().split())# 도화지canvas = [list(map(int, input().split())) for _ in range(n)]# 방문 여부visited = [[False] * m for _ in range(n)]# 그림의 개수num_of_pictures = 0# 가장 넓은 그림max_size = 0def bfs(x, y): queue = deque([(x, y)]) visited[x][y] = True dx = [-1, 1, 0, 0] dy = [0..