Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- SuNiNaTas
- wargame
- 써니나타스
- 정렬
- CTF
- 수학
- Incognito
- 백준
- 문자열
- xcz.kr
- Network
- Web Hacking
- cryptography
- Forensics
- writeup
- 그리디 알고리즘
- Text
- 인코그니토
- C
- HackCTF
- Digital Forensics
- MySQL
- 사칙연산
- 구현
- misc
- Python
- Database
- php
- Web
- N0Named
Archives
- Today
- Total
보안을 그리다, 훈이
[Baekjoon/Python3] 9095번 1, 2, 3 더하기 본문
Programming/Python & Data Structures
[Baekjoon/Python3] 9095번 1, 2, 3 더하기
HooNeee 2020. 12. 5. 22:08[Baekjoon/Python3] 9095번 1, 2, 3 더하기
9095번: 1, 2, 3 더하기
각 테스트 케이스마다, n을 1, 2, 3의 합으로 나타내는 방법의 수를 출력한다.
www.acmicpc.net
n = int(input())
res = [1, 2, 4]
for i in range(2, 9):
res.append(res[i] + res[i - 1] + res[i - 2])
for i in range(n):
num = int(input())
print(res[num - 1])
'Programming > Python & Data Structures' 카테고리의 다른 글
[Baekjoon/Python3] 9296번 Grading Exams (0) | 2020.12.05 |
---|---|
[Baekjoon/Python3] 9243번 파일 완전 삭제 (0) | 2020.12.05 |
[Baekjoon/Python3] 9086번 문자열 (0) | 2020.12.05 |
[Baekjoon/Python3] 9085번 더하기 (0) | 2020.12.05 |
[Baekjoon/Python3] 8958번 OX퀴즈 (0) | 2020.12.05 |
Comments