one Book a Day

  • 홈
  • 태그
  • 방명록
  • GitHub

1865 2

[백준][Python] 1865 웜홀

시작정점을 어디로 두어야 하는가? 초기 최단거리값을 float('inf)가 아닌 정수로 두어야 하는 이유가 무엇인가? 두가지에 대해 고민해볼 필요가 있는 문제 두 가지 조건에 따라 시작 지점에서 도달 할 수 있는 또는 도달할 수 없는 음수 사이클 판별 가부가 결정된다. import sys input = sys.stdin.readline def bellman_ford(start): dists[start] = 0 for cycle in range(n): for cur_node, next_node, cost in edges: if dists[cur_node] + cost < dists[next_node]: dists[next_node] = dists[cur_node] + cost if cycle == n - ..

practivceAlgorithm/다시 봐야할 문제들 2021.12.08

[SWEA][Python] 1865 동철이의 일 분배

확률을 인자로 넘기는 백트래킹. def dfs(row, p): global max_p if row == N: max_p = p return for col in range(N): next_p = p * P[row][col] if not col_check[col] and next_p > max_p: col_check[col] = True dfs(row + 1, next_p) col_check[col] = False for test in range(1, int(input()) + 1): N = int(input()) P = [list(map(lambda x: int(x) / 100, input().split())) for __ in range(N)] col_check = [False] * N max_p = 0..

practivceAlgorithm/swexpertacademy 2021.10.07
1
더보기
프로필사진
  • 분류 전체보기 (720)
    • webDeveloper (11)
      • Browser (5)
      • Test (1)
    • frontend (50)
      • HTML (6)
      • CSS&Design (14)
      • JavaScript (16)
      • TypeScript (2)
      • React (8)
      • 상태관리 (2)
      • d3.js & three.js (1)
    • backend (21)
      • Node.js (0)
      • Django&Python (15)
      • Java (2)
      • Spring Boot (0)
      • DB (4)
    • practivceAlgorithm (570)
      • 자료구조&알고리즘 (29)
      • PYTHON 기능연습 (11)
      • 백준 (379)
      • swexpertacademy (84)
      • programmers (23)
      • codeforce (20)
      • LeetCode (0)
      • 다시 봐야할 문제들 (22)
    • Computer Science (37)
      • 소프트웨어 공학 (9)
      • 네트워크 (10)
      • 운영체제 (7)
      • 컴퓨터 구조 (4)
      • DB (2)
      • 모델링 & 아키텍쳐 & 패턴 (3)
      • IOT (2)
    • GitHub&Git (7)
    • 후기 (3)
    • IDE (1)
    • Memo (1)

Tag

TRIE, dfs, 2018, 슬라이딩 윈도우, 분할정복, http, JS 30, 비트마스킹, React, Python, 백준, 비트마스크, 파이썬, JS, kakao 2019, codeforce 702, DP, BOJ, 다익스트라, kakao 2018,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

Archives

Calendar

«   2025/06   »
일 월 화 수 목 금 토
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

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바