Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

[감자] 2021年06月22日 #110

Closed
dkswndms4782 wants to merge 1 commit into main from potato2
Closed

[감자] 2021年06月22日 #110

dkswndms4782 wants to merge 1 commit into main from potato2

Conversation

@dkswndms4782
Copy link
Collaborator

@dkswndms4782 dkswndms4782 commented Jun 22, 2021

📌 푼 문제들


📝 간단한 풀이 과정

피보나치수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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /