Program Programming Programmer

  • 홈
  • 방명록
  • 관리자
  • 글쓰기

Base Conversion 2

BAEKJOON 2685 - Nim-B Sum

문제: https://www.acmicpc.net/problem/2685 문제The game of NIM is played with any number of piles of objects with any number of objects in each pile. At each turn, a player takes one or more (up to all) objects from one pile. In the normal form of the game, the player who takes the last object is the winner. There is a well-known strategy for this game based on the nim-2 sum.The Nim-B sum (nim sum b..

Algorithm, Data structure/Solved Algorithmic Problem 2016.12.07

BAEKJOON 1052 - 물병

문제: https://www.acmicpc.net/problem/1052 완전 탐색으로 시도를 할 경우 시간 제한안에 풀 수 없기 때문에 다른 방법을 찾아봐야 됩니다.n, k 가 19, 1 일 경우19를 2진수로 표현할 경우 10011 이 됩니다. 이 중 16의 경우 하나의 물병으로 옮겨 담을 수 있고 2와 1이 남게 됩니다. 여기서 1을 더하게 되면 4가 남게 되고 4에 4와 8을 더하게 되면 정답이 됩니다.만약 k가 2일 경우 1만 더하게 되면 16과 4가 남기 때문에 정답이 됩니다.이와 같이 n을 2진수로 표현한 후 bit count 가 k 보다 같거나 작아질 때 까지 물을 더하면 답을 구할 수 있습니다. 1234567891011121314151617181920212223242526272829303..

Algorithm, Data structure/Solved Algorithmic Problem 2016.11.13
이전
1
다음
더보기
프로필사진

Program Programming Programmer

프로그래머

  • 분류 전체보기 (142)
    • Deep learning (17)
    • Python (0)
    • Algorithm, Data stru.. (125)
      • Solved Algorithmic P.. (120)
      • Popular Algorithms (3)
      • Basic concepts (2)

Tag

Shoelace Formula, Complete Search, Divide And Conquer, Simulation, sort, bipartite matching, binary search, memoization, bit mask, Math, Josephus, Base Conversion, GREEDY, string, binomial coefficient, Erathosthenes, Deterministic finite automaton, convex hull, dfs, dynamic programming,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

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

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바