반응형
http://euler.synap.co.kr/prob_detail.php?id=53
Skillist 설명---------------------------------------------------------------------------------
public static void main (String[] args){
int total = 0;
for(int n=1;n<101;n++){
for(int r=1;r<n;r++){
BigInteger result = BigInteger.valueOf(1);
for(int up=n;up>r;up--){
result = result.multiply(BigInteger.valueOf(up));
}
for(int down=n-r;down>1;down--){
result = result.divide(BigInteger.valueOf(down));
}
if(result.compareTo(BigInteger.valueOf(999999)) == 1){
total+=1;
}
}
}
System.out.println(total);
}
반응형
'코딩 테스트 > Project Euler @ kr' 카테고리의 다른 글
2) 피보나치 수열에서 4백만 이하이면서 짝수인 항의 합 (0) | 2017.04.12 |
---|---|
1) 1000보다 작은 자연수 중에서 3 또는 5의 배수를 모두 더하면? (0) | 2017.04.12 |
52) 2배, 3배, 4배, 5배, 6배의 결과도 같은 숫자로 이루어지는 가장 작은 수 (0) | 2017.03.06 |
51) 일부 숫자를 치환했을 때 8개의 서로 다른 소수가 생기는 가장 작은 소수 (0) | 2017.03.06 |
50) 1백만 이하의 소수 중 가장 길게 연속되는 소수의 합으로 표현되는 수는? (0) | 2017.03.03 |