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 | 29 | 30 |
Tags
- Convolutional Neural Network
- 냥코 센세
- 소인수분해
- mnist
- c#
- bayesian
- 비샤몬당
- 히토요시
- Autoencoder
- 자전거 여행
- backpropagation
- 딥러닝
- neural network
- A Neural Algorithm of Artistic Style
- 역전파법
- 수달
- 오토인코더
- CNN
- SQL
- 합성곱 신경망
- 오일러 프로젝트
- Gram matrix
- project euler
- deep learning
- 베이지안
- 전처리
- 역전파
- 소수
- 신경망
- Python
Archives
- Today
- Total
통계, IT, AI
9. Special Pythagorean triplet 본문
1. 개요
문제는 이곳에서 확인할 수 있다. 합이 1000인 서로 다른 3개의 자연수 가운데, 가장 큰 수의 제곱이 나머지 두 수의 제곱의 합과 같은 자연수를 찾고 그것의 곱을 구하는 것이 목표이다.
2. Ver 1.0
가장 작은 자연수를
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | using System; class ProjectEuler { static void Main( string [] args) { for ( int a=1; a<=332; a++) { for ( int b=a+1; b<=(1000-a)/2-1; b++) { int c = 1000 - a - b; if (c*c == a*a + b*b) { Console.WriteLine( "a = " + Convert.ToString(a)); Console.WriteLine( "b = " + Convert.ToString(b)); Console.WriteLine( "c = " + Convert.ToString(c)); Console.WriteLine( "product Of a, b and c = " + Convert.ToString(a*b*c)); } } } } } |
답은 31875000이다. 문제의 해설을 보니 더 기발한 방법이 있지만 이해가 어려워 Ver 2.0은 작성하지 않는다.
'IT > PROJECT_EULER' 카테고리의 다른 글
11. Largest product in a grid (0) | 2017.01.03 |
---|---|
10. Summation of primes (0) | 2017.01.03 |
8. Largest product in a series (0) | 2017.01.01 |
7. 10001st prime (0) | 2016.01.14 |
6. Sum square difference (0) | 2016.01.10 |