nonneng.ee
Daeun-rithm
nonneng.ee
전체 방문자
오늘
어제
  • 분류 전체보기 (51)
    • Back-end (17)
      • Server (3)
      • Database (3)
      • Spring (9)
      • Node.js (1)
    • Book (1)
      • 이펙티브 자바 (0)
      • 대규모 시스템 설계 (1)
    • Algorithm (1)
      • Greedy, Implementation (6)
      • Dynamic Programming (5)
      • Data Structure (3)
      • Sorting (2)
      • Concept (1)
    • TIL (11)
    • Software (3)
      • Design Pattern (3)
    • Computer Science (1)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • 자바
  • 백준
  • 이펙티브 자바
  • 가상머신
  • 수동설치
  • Java
  • 아이템8
  • DP
  • API
  • Spring
  • jwt
  • 에러
  • node js
  • 우분투
  • 아이템 23
  • MySQL
  • 아이템6
  • 파이썬
  • 구현
  • 아이템 25
  • APM
  • 컴파일설치
  • Restful API
  • 아이템9
  • 서버
  • 브루트포스
  • Postman
  • JPA
  • 구동원리
  • 소스설치

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
nonneng.ee

Daeun-rithm

Algorithm/Greedy, Implementation

[Python] 백준 #1085 직사각형에서 탈출

2021. 6. 21. 19:12

https://www.acmicpc.net/problem/1085

 

1085번: 직사각형에서 탈출

한수는 지금 (x, y)에 있다. 직사각형의 왼쪽 아래 꼭짓점은 (0, 0)에 있고, 오른쪽 위 꼭짓점은 (w, h)에 있다. 직사각형의 경계선까지 가는 거리의 최솟값을 구하는 프로그램을 작성하시오.

www.acmicpc.net

 

1
2
3
4
5
6
7
x, y, w, h = map(int, input().split())
dis_list = []
dis_list.append(w - x)
dis_list.append(x)
dis_list.append(h - y)
dis_list.append(y)
print(min(dis_list))
cs

'Algorithm > Greedy, Implementation' 카테고리의 다른 글

[Python] 백준 #7568 덩치  (0) 2022.02.26
[Python] 백준 #1874 스택 수열  (2) 2021.06.23
[Python] 백준 #1181 단어 정렬  (0) 2021.06.21
    'Algorithm/Greedy, Implementation' 카테고리의 다른 글
    • [Python] 백준 #18111 마인크래프트
    • [Python] 백준 #7568 덩치
    • [Python] 백준 #1874 스택 수열
    • [Python] 백준 #1181 단어 정렬
    nonneng.ee
    nonneng.ee

    티스토리툴바