one Book a Day

  • 홈
  • 태그
  • 방명록
  • GitHub

731 2

[Codefroce][Python] div.3 #731 - D. Co-growing Sequence

앞전의 이진수에서 1이 있는 자릿수를 계승하는 수열을 growing sequence라 하고 그렇지 않은 수열을 xor연산을 통해 growing sequence로 만들어 주는 수열을 Co-growing Sequence라 합니다. 전에 있는 값을 pivot으로 가져가야할 1의 위치를 저장하는 기준값으로 정하고 pivot에는 1이 있는데 현 수열의 값에는 없다면 Co-growing Sequence가 그만큼의 값을 가져가게끔 코드를 짰습니다. import sys input = sys.stdin.readline for test in range(int(input())): n = int(input()) x = list(map(int, input().split())) pivot = x[0] y = [0] * n for..

practivceAlgorithm/codeforce 2021.10.03

[Codefroce][Python] div.3 #731 - A. Shortest Path with Obstacle

점 a에서 b까지의 최소거리를 구하는 문제. 방해물 f가 한개 존재하지만 한개로는 무수히 많은 path를 방해할 수 없다. 방해 가능한 경우의 수는 a와 b와 f가 일직선상에 존재하고 f 가 두 점 사이에 있을 때. 이경우만 예외처리해서 +2 해주면 된다. import sys input = sys.stdin.readline for test in range(int(input())): input() a_x, a_y = map(int, input().split()) b_x, b_y = map(int, input().split()) if a_x < b_x: a_x, b_x = b_x, a_x if a_y < b_y: a_y, b_y = b_y, a_y f_x, f_y = map(int, input().split..

practivceAlgorithm/codeforce 2021.10.03
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

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

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

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.

티스토리툴바