Sun의 기술블로그
close
프로필 배경
프로필 로고

Sun의 기술블로그

  • 분류 전체보기 (59)
    • 도커 (1)
    • 프론트엔드 (1)
      • HTML (0)
      • CSS (0)
      • JavaScript (0)
      • React (1)
    • 코딩테스트 (48)
    • SSAFY (2)
      • Review (1)
    • 일상 (3)
  • 홈
  • 태그
  • 방명록
[백준/파이썬] 2655 미로만들기

[백준/파이썬] 2655 미로만들기

#문제링크 https://www.acmicpc.net/problem/2665 2665번: 미로만들기 첫 줄에는 한 줄에 들어가는 방의 수 n(1 ≤ n ≤ 50)이 주어지고, 다음 n개의 줄의 각 줄마다 0과 1이 이루어진 길이가 n인 수열이 주어진다. 0은 검은 방, 1은 흰 방을 나타낸다. www.acmicpc.net #나의풀이 import sys from heapq import heappush, heappop delta = [[1, 0], [0, 1], [-1, 0], [0, -1]] if __name__=="__main__": N = int(sys.stdin.readline()) board = [] for _ in range(N): board.append(list(map(int, sys.stdin..

  • format_list_bulleted 코딩테스트
  • · 2023. 1. 30.
  • textsms

[백준/파이썬] 22866 탑 보기

#문제링크 https://www.acmicpc.net/problem/22866 22866번: 탑 보기 3번째 건물에서 볼 수 있는 건물은 2, 4, 8번째 건물로 총 3개를 볼 수 있다. 그 중 3번째 건물과 가장 가까운 건물은 2, 4번째 있는 건물로 이 중 번호가 작은 번호인 2가 답이 된다. www.acmicpc.net #나의풀이 import sys if __name__=="__main__": N = int(sys.stdin.readline()) arr = list(map(int, sys.stdin.readline().split())) near = [[-1, 2147000000] for _ in range(N)] count = [] stack = [] for i in range(N): while l..

  • format_list_bulleted 코딩테스트
  • · 2023. 1. 19.
  • textsms

[백준/파이썬] 16120 PPAP

#문제링크 https://www.acmicpc.net/problem/16120 16120번: PPAP 첫 번째 줄에 문자열이 주어진다. 문자열은 대문자 알파벳 P와 A로만 이루어져 있으며, 문자열의 길이는 1 이상 1,000,000 이하이다. www.acmicpc.net #나의풀이 import sys from collections import deque if __name__=="__main__": S = sys.stdin.readline().rstrip() stack = [] for i in range(len(S)): if len(stack) == 0: stack.append(S[i]) continue if len(stack) > 2: if "".join(stack[len(stack)-3:len(stac..

  • format_list_bulleted 코딩테스트
  • · 2023. 1. 17.
  • textsms

[백준/파이썬] 5430 AC

#문제링크 https://www.acmicpc.net/problem/5430 5430번: AC 각 테스트 케이스에 대해서, 입력으로 주어진 정수 배열에 함수를 수행한 결과를 출력한다. 만약, 에러가 발생한 경우에는 error를 출력한다. www.acmicpc.net #나의풀이 import sys from collections import deque if __name__=="__main__": N = int(sys.stdin.readline()) for _ in range(N): commands = sys.stdin.readline().strip() len_arr = int(sys.stdin.readline()) s = sys.stdin.readline().rstrip() if s == "[]": arr ..

  • format_list_bulleted 코딩테스트
  • · 2023. 1. 17.
  • textsms

[백준/파이썬] 27211 도넛 행성 쇼미더코드 3회차

#문제링크 https://www.acmicpc.net/problem/27211 27211번: 도넛 행성 준겸이는 $N \times M$칸으로 이루어진 도넛 모양의 행성에 살고 있다. 준겸이가 살고 있는 행성에는 위 그림처럼 격자 모양으로 줄이 그어져 있다. 행성의 각 칸은 숲으로 막혀 있거나, 지나갈 수 www.acmicpc.net #나의풀이 import sys sys.stdin = open('../input.txt') delta = [[-1, 0], [0, 1], [1, 0], [0, -1]] def DFS(x, y): board[x][y] = 1 for i in range(4): dx = x + delta[i][0] dy = y + delta[i][1] if dx < 0: dx += N if dx =..

  • format_list_bulleted 코딩테스트
  • · 2023. 1. 15.
  • textsms

[백준/파이썬] 1446 지름길

#문제링크 https://www.acmicpc.net/problem/1446 1446번: 지름길 첫째 줄에 지름길의 개수 N과 고속도로의 길이 D가 주어진다. N은 12 이하인 양의 정수이고, D는 10,000보다 작거나 같은 자연수이다. 다음 N개의 줄에 지름길의 시작 위치, 도착 위치, 지름길의 길이 www.acmicpc.net #나의풀이 import sys if __name__=="__main__": N, D = map(int, sys.stdin.readline().split()) arr = [[] for _ in range(10001)] for _ in range(N): start, end, express = map(int, sys.stdin.readline().split()) arr[start]..

  • format_list_bulleted 코딩테스트
  • · 2023. 1. 12.
  • textsms
  • navigate_before
  • 1
  • 2
  • 3
  • 4
  • ···
  • 8
  • navigate_next
공지사항
전체 카테고리
  • 분류 전체보기 (59)
    • 도커 (1)
    • 프론트엔드 (1)
      • HTML (0)
      • CSS (0)
      • JavaScript (0)
      • React (1)
    • 코딩테스트 (48)
    • SSAFY (2)
      • Review (1)
    • 일상 (3)
최근 글
인기 글
최근 댓글
태그
  • #쇼미더코드 3회차
  • #백준
  • #Level1
  • #SSAFY
  • #실패율
  • #프로그래머스
  • #파이썬
  • #구현
  • #엠로 탈락
  • #8기
전체 방문자
오늘
어제
전체
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바