Giter Site home page Giter Site logo

baekjoon_solutions's Introduction

rhapso73

https://www.acmicpc.net/user/rhapso73

https://solved.ac/profile/rhapso73

1095

  • 이하 순서로 진행
    1. M 이하 소수찾기
    2. (S+F)!, S!, F!를 각각 소인수분해하여 S+FCS의 소인수분해
    3. M 이하의 수 중에 S+FCS의 소수와 지수 조합 내에서 만들 수 있는 가장 큰 수 찾기
  • 이후 다른 사람이 푼 코드를 보니 2. 이후 바로 S+FCS에 직접 M 이하의 수들을 하나씩 나누기도 함.
  • 팩토리얼할 수가 큰 경우 소인수분해로 접근하는 자체가 효율적인가?..

1058

  • 행렬곱으로 거리가 2인 사람까지 세기
  • 2d리스트 복사시 주소값이 같은 문제는 b= a[::1]로 해결되지 않아 값이 같이 변환되는 문제 (id(a)로 확인하면 다른 값이었지만 각 요소가 같은 주소를 가지는 것으로 추정(확인안함;)) -> copy.deepcopy로 해결
  • a = [[0]*N]*N 방법으로 리스트 선언시에도 위와 동일한 포인터 문제 발생. a=[0][1]을 바꾸면 [i][1]이 전부 바뀜

1016

  • 에라토스테네스의 체를 응용하여 해결
  • A, B가 매우 큰 값이라 그대로 사용하는 것을 피하기 위해 별도의 B**0.5의 크기를 가진 checker를 만듬
    • 나중에보니 크기가 어처구니없이 크진 않아서 굳이 별도의 checker를 생성하지 않아도 index처리만 잘 해주면 되는 거였다;;
  • 그래도 더 큰 수에서도 잘 돌아갈테니까 만족
  • 그런데 더 큰 수도 index와 실제 숫자 사이의 관계만 잘 처리해주면 돌아갈 것 같기도 하다.

1011

  • 숫자에 따른 워프횟수의 규칙성 발견
    1. For 16: 1, 2, 3, 4, 3, 2, 1
    2. For 20: 1, 2, 3, 4, 4, 3, 2, 1
  • 위 두 케이스는 1광년만 거리가 추가되어도 워프 횟수가 추가되어야하는 경우
  • 워프횟수 변화의 기준점이 n^2(case 1)과 n^2+n(case 2)이라는 점을 알아내 해결
    1. n^2= n(n+1) - n (n까지 정수합*2 - n)
    2. n^2+n = n(n+1) (n까지 정수합*2)

baekjoon_solutions's People

Contributors

ieehee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.