본문 바로가기

Kelly's journey to a coding master

검색하기
Kelly's journey to a coding master
프로필사진 개발하는 통계학도 켈리

  • 분류 전체보기 (18)
    • 학부연구생 (1)
    • Algorithm (10)
    • Android (2)
    • Python (2)
    • Design Patterns (2)
    • 사소한 궁금증 (1)
    • Insights (0)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Tags
  • 문자열
  • 단순구현
  • 시뮬레이션
  • deepcopy금지
  • 시간복잡도
  • 카카오
  • 백준
  • 플로이드워샬
  • DFS
  • BFS
  • 파이썬
  • LEN함수
  • 코딩테스트
  • 알고리즘
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록BFS (1)

Kelly's journey to a coding master

백준 1926번 그림

문제 https://www.acmicpc.net/problem/1926 1926번: 그림 어떤 큰 도화지에 그림이 그려져 있을 때, 그 그림의 개수와, 그 그림 중 넓이가 가장 넓은 것의 넓이를 출력하여라. 단, 그림이라는 것은 1로 연결된 것을 한 그림이라고 정의하자. 가로나 세로 www.acmicpc.net 풀이 import sys def bfs(x, y): dx = [0, 1, 0, -1] dy = [1, 0, -1, 0] w = 1 # 그림의 넓이 while queue: x,y = queue.pop() for i in range(4): new_x = x + dx[i] new_y = y + dy[i] if (new_x = n or new_y = m)..

Algorithm 2024. 2. 9. 23:39
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바