Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

Conversation

@dkswndms4782
Copy link
Collaborator

📌 푼 문제들


📝 간단한 풀이 과정

피보나치수2

  • 피보나치5와 같지만, n의 값이 최대 90이었기때문에 c++에서는 int 배열에 값들을 다 담을 수 없었음
  • 그래서 long long int로 배열 자료형 선언

다리놓기

  • factorial을 30까지 다 해준 후 arr에 넣으려니 문제 발생(unsigned long long으로 풀어도 안됨)
  • 그래서 double로 바꿔서 계산한 후 ceil함수로 소수점 반올림, 후 int로 바꿔 출력했으나 틀림
  • 조합문제라고 생각했기때문에 m*(m-1)* ... * (m - n + 1)/n!을 사용
  • num함수로 m*(m-1)* ... * (m - n + 1)이부분 구해줌
  • factorial은 계속 구해주면 0.5초안에 풀지못할거같아 15!까지는 arr에 넣어줌
  • n이 m과 같으면 1 출력, 아니면 n과 m-n중 더 작은 값을 n으로 할당하고 num(m,n)/factorial[n]출력

@dkswndms4782 dkswndms4782 changed the title [감자] 2021.06.23 [감자] 2021.06.22 Jun 22, 2021
@dkswndms4782 dkswndms4782 deleted the potato2 branch June 22, 2021 16:25
@dkswndms4782 dkswndms4782 restored the potato2 branch June 22, 2021 16:25
@CoodingPenguin CoodingPenguin deleted the potato2 branch June 22, 2021 17:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants