지우개원정대의 개발 정복기
close
프로필 배경
프로필 로고

지우개원정대의 개발 정복기

    • 분류 전체보기
      • 공부하자!
        • 알고리즘
        • iOS
        • TIL
      • 프로젝트
      • CS
        • 컴퓨터 구조
  • mode_edit_outline글작성
  • settings환경설정
  • 홈
  • 태그
  • 방명록
백준 2667번 단지번호붙이기 파이썬

백준 2667번 단지번호붙이기 파이썬

from collections import deque import sys N = int(input()) M = [[0] * N for _ in range(N)] for i in range(N): line = sys.stdin.readline() for j in range(N): M[i][j] = int(line[j]) dr = [-1, 1, 0, 0] dc = [0, 0, -1, 1] def bfs(x, y): queue = deque() queue.append((x, y)) M[x][y] = 0 cnt = 1 global num num += 1 while queue: x, y = queue.popleft() for i in range(4): nx = x + dr[i] ny = y + dc[i] if n..

  • format_list_bulleted 공부하자!/알고리즘
  • · 2021. 9. 7.
  • textsms
  • 1
공지사항
전체 카테고리
  • 분류 전체보기
    • 공부하자!
      • 알고리즘
      • iOS
      • TIL
    • 프로젝트
    • CS
      • 컴퓨터 구조
최근 글
인기 글
최근 댓글
태그
  • #프로그래머스
  • #백준
  • #Python
  • #ios
  • #파이썬
  • #백준알고리즘
  • #SWIFT
  • #알고리즘공부
  • #알고리즘
  • #파이썬공부
전체 방문자
오늘
어제
전체
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바