그리디 알고리즘 21

백준_11000 강의실 배정 (자바) / 그리디 알고리즘

시간&메모리 제한 문제 입력&출력 문제풀이 package com.Back; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.PriorityQueue; import java.util.StringTokenizer; public class Back_11000 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new Buffer..

백준_2012 등수 매기기(자바) / 그리디 알고리즘

시간&메모리 제한 문제 입력&출력 문제풀이 package com.Back; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Back_2012 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); int arr[] = new..

백준_1080 행렬(자바) / 그리디 알고리즘

시간&메모리 제한 문제 입력&출력 문제 package com.Back; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Back_1080 { static int ori[][]; static int cha[][]; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringT..

백준_11497 통나무 건너뛰기(자바) / 그리디

시간&메모리 제한 문제 입력&출력 문제풀이 package com.Back; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; import java.io.BufferedReader; import java.io.IOException; public class Back_11497 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int testCase = Intege..

백준_13305 주유소(자바) / 그리디 알고리즘

시간&메모리 제한 문제 입력&출력 문제 package com.Back; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Back_13305 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); long[] ..

백준_5545 최고의 피자(자바) / 그리디 알고리즘

시간&메모리 제한 문제 입력&출력 문제풀이 package com.Back; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.StringTokenizer; public class Back_5545 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedRe..

백준_18310 안테나(자바) / 그리디 알고리즘

시간&메모리 제한 문제 입력&출력 문제풀이 package com.Back; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.StringTokenizer; public class Back_18310 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(S..

백준_19941 햄버거 분배(자바) / 그리디 알고리즘

시간&메모리 제한 문제 입력&출력 문제풀이 package com.Back; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.StringTokenizer; public class Back_19941 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(..

백준_11501 주식(자바) / 그리디 알고리즘

시간&메모리 제한 문제 입력&출력 문제풀이 package com.Back; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Back_11501 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int testCase = Integer.parseInt(br.readLine())..

백준_11399 ATM(자바) / 그리디 알고리즘

시간 & 메모리 제한 문제 입력 & 출력 그리디 알고리즘을 이용한 문제풀이 package com.Back; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class Back_11399 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int..