https://www.acmicpc.net/problem/17951import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.Arrays;import java.util.StringTokenizer;public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int N = Integer.parseInt(s..
https://www.acmicpc.net/problem/17281 import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.Arrays;public class Main { static int N, maxScore = 0; //이닝 수, 픽스된 선수 숫자 static int[] seq = new int[9];//선발 순서 static boolean[] checked = new boolean[9], base = new boolean[4]; //사용된 선수 static int[][] pResult; public static void main(String[] args) throws Exception{ BufferedRead..
https://www.acmicpc.net/problem/17135import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.ArrayList;import java.util.HashSet;import java.util.List;import java.util.PriorityQueue;import java.util.Set;import java.util.StringTokenizer;public class Main { static int[][] map; static int N, M, D, maxKill = 0; static List enemies = new ArrayList(); static int ivy = 0; public..
https://www.acmicpc.net/problem/1106import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.Arrays;import java.util.StringTokenizer;public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int C = I..
https://www.acmicpc.net/problem/9084import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.Arrays;import java.util.StringTokenizer;public class Main { static int[] coins, dp; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(br.readLine()); ..
https://www.acmicpc.net/problem/14567import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.*;public class Main_14567 { static int N, M; static int[] dp; static ArrayList[] prerequisite; public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new Stri..
https://www.acmicpc.net/problem/3649import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.Arrays;public class Main { static String input = null; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); while ((input = br.readLine(..
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWFPoj1qANoDFAV0 SW Expert AcademySW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!swexpertacademy.comimport java.io.BufferedReader;import java.io.InputStreamReader; public class Solution { static long N; public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStrea..
https://swexpertacademy.com/main/solvingProblem/solvingProblem.doimport java.io.BufferedReader;import java.io.InputStreamReader;import java.util.*;public class Solution { static StringTokenizer st; static boolean[] visited; public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int tc = Integer.par..
https://www.acmicpc.net/problem/20436import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.HashMap;import java.util.Map;import java.util.StringTokenizer;public class Main_20436 { static Map lefts, rights; static int totalTime = 0, distance; static Pos sL, sR; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedRea..
Java의 String format이란? printf() 메소드에서 사용하며, String 클래스의 static 메소드 중 하나이다. 문자열의 형식을 설정하며, C언어의 printf() 처럼 형식을 지정해 출력할 수 있게 한다. 종류1. "%d" : 정수(int)를 출력문자열 길이 고정 : 상수 + d 조합"%5d" : 길이 5 고정, 숫자 오른쪽부터 채워짐"%-5d" : 길이 5 고정, 숫자 왼쪽부터 채워짐"%05d" : 길이 5 고정, 여백 대신 특정 숫자(0)가 채워짐숫자를 끊어서 표현하고 싶은 경우 "%,d_" : 디폴트, 3자리씩 끊음System.out.printf("%5d_", 1); // □□□□1_System.out.printf("%-5d_", 1); //1□□□□_System.out.p..
https://www.acmicpc.net/problem/14499import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.HashMap;import java.util.Map;import java.util.StringTokenizer;public class Main_14499 { static int[] nextBase = {0, 3, 4, 2, 5}; //시작 위치 윗면 1, 동쪽 3 기준 static int[][] map; static int[][] roll = {{0, 0},{0, 1}, {0, -1}, {-1, 0}, {1, 0}}; //동서북남 static Map diceNum = new H..