Programming/Solutions (52) 썸네일형 리스트형 [BAEKJOON] 2581번 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960#include #include int is_prime(int n); int main(){ int m, n; int sum = 0; int i; int min = -1; scanf("%d", &m); scanf("%d", &n); for (i = m; i [BAEKJOON] 1978번 123456789101112131415161718192021222324252627282930313233343536373839404142#include int is_prime(int n); int main(){ int n; int i; int count = 0; int lim; scanf("%d", &lim); for (i = 0; i [Project Euler] Problem 017 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 import java.util.HashMap; import java.util.Map; public class Problem017 { public static void main(String[] args) { System.out.println(run()); } public static String run() { Map map = new HashMap(); int result = ".. [Project Euler] Problem 016 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950public class Problem016 { private final static int A = 2; private final static int N = 1000; public static void main(String[] args) { System.out.println(run()); } public static String run() { int[] arr = new int[350]; int sum = 0; /*Initialize array by -1*/ for(int i = 0; i = 0) && (j > 0); --j) { if(arr[j.. [Project Euler] Problem 015 를 계산하면 된다. 문제는 분자의 값이 너무 커서 8바이트 자료형으로도 저장할 수 없다는 것. 따라서 40!과 20!20!을 한 번에 계산하고 나누는 것이 아니라 하나씩 나눈다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 public class Problem015 { private static final int V = 20; private static final int H = 20; public static void main(String[] args) { System.out.println(run()); } public static String run() { long result = 1L; for(int i = 0; i [Project Euler] Problem 014 12345678910111213141516171819202122232425262728293031323334353637public class Problem014 { public static void main(String[] args) { System.out.println(run()); } public static String run() { long temp; long result = 0; int max = 0; int count; for(int i = 2; i max) { max = count; result = i; } } return Long.toString(result); } }Colored by Color Scriptercs 정답: 837799실행 시간: 0.6초 단순하게 풀었다. 문제의 내용을 그대.. [Project Euler] Problem 013 (너무 길어서 캡처 대신 텍스트 복사) 아래에 50자리 숫자가 100개 있습니다. 이것을 모두 더한 값의 첫 10자리는 얼마입니까? 더보기 37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 74324986199524741059474233309513058123726617309629 91942213363574161572522430563301811072406154908250 23067588207539346171171980310421047513778063246676 89261670696623633820136378418383684178734361726757 28112879812849.. [Project Euler] Problem 012 (Java)1234567891011121314151617181920212223242526272829303132333435363738394041424344454647public class Problem012 { public static void main(String[] args) { long beginTime = System.currentTimeMillis(); System.out.println(run()); long endTime = System.currentTimeMillis(); System.out.println((endTime - beginTime) + "ms"); } public static String run() { int n = 0; int triNum = 0; int max = 0; int .. Prev 1 2 3 4 5 6 7 Next