백준 벌집

    [백준] 2292번 벌집 [Java]

    https://www.acmicpc.net/problem/2292 문제 N = 1 일 때는 1개의 방 N = 2 일 때는 2개의 방 N = 8 일 때는 3개의 방 이런 식으로 N 번까지 갈 때 최소 개의 방으로 방문하는 문제이다. 방의 개수는 6개씩 늘어나는 것을 알 수 있다. 알고리즘 [풀이 방법] import java.util.Scanner; //벌집 public class B2292 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int count = 1; int range = 2; if(N == 1){ System.out.println(1); }else { whil..