반응형

그리디알고리즘

    [백준] 2217.로프(Java8)

    [백준] 2217.로프(Java8)

    문제 풀이 package greedy; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws IOException{ // 로프 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine());//로프의 개수 int[] arr = new int[n];//각 로프의 최대 중량 for(int i = 0..

    [백준] 11047.동전 0(Java8)

    [백준] 11047.동전 0(Java8)

    문제 풀이 package greedy; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { // 동전 0 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()," "); int n = Integer.parseInt(s..

    [백준] 11399.ATM(Java8)

    [백준] 11399.ATM(Java8)

    문제 풀이 package greedy; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException{ // ATM BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine());//사람의 수 int[] arr = new ..

반응형