티스토리 뷰

문제 https://www.acmicpc.net/problem/1017



진행중...

1-1. 소수인지 체크하는 method 생성 (루트 보다 작은 값 체크)

1-2 2~2000까지 수 중 소수인 값 담는 ArrayList생성

2. 리스트 하나씩 조합하여 소수 체크(재귀 형식으로 체크 or DFS?) 


소스코드


import java.io.File;
import java.io.FileNotFoundException;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Stack;

public class Baekjoon1017 {
	
	public static void main(String[] args) throws FileNotFoundException {

		long start = System.currentTimeMillis();
		
		File file =new File("D:\\dev\\worksspace\\Solution\\src\\Baekjoon1017.txt");
		Scanner sc = new Scanner(file);
		
		int test_case_num = 0;
		int max_test_case = Integer.parseInt(sc.nextLine());
		
		while (sc.hasNext()) {
			if(test_case_num >= max_test_case) break;
			
			int n = sc.nextInt();
			int m = sc.nextInt();
			
			test_case_num++;
			
			solutionMap = new HashMap();
			powMap = new HashMap();
			
			BigDecimal result = solveProb(n, m);
			
			
			System.out.println(result);
			//System.out.println(solutionMap.toString());
		}
		sc.close();

		long end = System.currentTimeMillis();
		System.out.println( "실행 시간 : " + ( end - start )/1000.0 );
	}

	private static BigDecimal solveProb(int n, int m) {
		BigDecimal result = BigDecimal.ZERO;
		


		return result;
	}


}
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/04   »
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
글 보관함