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
- 합성곱 신경망
- 수달
- Convolutional Neural Network
- mnist
- c#
- SQL
- 비샤몬당
- 히토요시
- 딥러닝
- 전처리
- 베이지안
- 오일러 프로젝트
- 신경망
- backpropagation
- 냥코 센세
- 역전파법
- 소수
- Autoencoder
- Python
- CNN
- bayesian
- Gram matrix
- 오토인코더
- 역전파
- project euler
- 소인수분해
- deep learning
- A Neural Algorithm of Artistic Style
- 자전거 여행
- neural network
Archives
- Today
- Total
통계, IT, AI
19. Counting Sundays, 20. Factorial digit sum 본문
1. 개요
풀이가 워낙 간단하여 19, 20번 두 문제를 푼다. 각각의 문제는 이곳과 이곳에서 확인할 수 있다. 19번 문제의 목표는 1901년 1월 1일부터 2000년 12월 31일에서 각 월의 1일이 일요일인 날의 수를 세는 것이다. 20번 문제는 \(100!\)의 각 자리의 수를 더하는 것이다.
2. Ver 1.0
# -*- coding: utf-8 -*- import datetime, math # 19. Counting Sundays print(sum(1 for y in range(1901, 2001) for m in range(1, 13) if datetime.date(y, m, 1).weekday() == 6 )) # 20. Factorial digit sum print(sum(int(i) for i in str(math.factorial(100))))
답은 각각 171, 648이다.
'IT > PROJECT_EULER' 카테고리의 다른 글
23. Non-abundant sums (0) | 2017.01.27 |
---|---|
21. Amicable numbers (0) | 2017.01.23 |
18. Maximum path sum I (0) | 2017.01.15 |
17. Number letter counts (0) | 2017.01.12 |
15. Lattice paths, 16. Power digit sum (0) | 2017.01.12 |
Comments