목록문제/백준_자바 (102)
sm 기술 블로그
import java.util.*; import java.io.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); StringBuilder sb = new StringBuilder(); int N = sc.nextInt(); int[] board = new int[N]; for (int i = 0; i < N; i++) { board[i] = sc.nextInt(); } int M = sc.nextInt(); int[][] dp = new int[N][N]; // 필요한 조건 입력 완료 // dp 채우기 for (int i = 0; i < N; i++) { dp[i][i] = 1; } fo..
import java.util.*; import java.io.*; class Main { static int M; static int N; static int[][] dxdy = { { 1, 0 }, { -1, 0 }, { 0, -1 }, { 0, 1 } }; static int[][] dp; static int[][] travelMap; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] tmp = br.readLine().split(" "); M = Integer.parseInt(tmp[0]); N..
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()); int[][] rc = new int[N][2]; int[][] dp = new int[N][N]; for (int i = 0; i < N; i++) { String[] tmp = br.readLine().split(" "); rc[i][0] = Integer.parseInt(tmp[0]); rc[i][1]..
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(); int T = Integer.parseInt(br.readLine()); for (int m = 0; m < T; m++) { int K = Integer.parseInt(br.readLine()); int[] page = new int[K + 1]; String[] tmp = br.readLine().spl..