목록문제/백준_자바 (102)
sm 기술 블로그
import java.util.*; import java.io.*; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); String[] sBits = br.readLine().split(" "); int[] P = new int[N]; int tmp = 0; for (int i = 0; i < N; i++) { P[i] = Integer.parseInt(sBits[i]); } Arrays.sort(P); for (int i ..
import java.util.*; import java.io.*; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); ArrayList timeList = new ArrayList(); ArrayList timeList2 = new ArrayList(); // 리스트에 값을 채워줌 for (int i = 0; i < N; i++) { String[] tmp = br.readLine().split(" "); int[] tmp..
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); Integer[] coinList = new Integer[N]; int cnt = 0; for (int i = 0; i K) { continue; } else { if (K == 0) { break; ..
import java.util.*; import java.io.*; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); String[] tmp1 = br.readLine().split(" "); int N = Integer.parseInt(tmp1[0]); int M = Integer.parseInt(tmp1[1]); int[][] arr = new int[N + 1][N + 1]; // 값 넣기 for (int i = 1; ..