완전탐색

· Dev/PS
import java.io.*; import java.util.*; public class Main { static BufferedReader br; static StringTokenizer st; static int N; static int[] arr; static int[][] states; static boolean[] nums; static int res; public static void main(String[] args) throws IOException { input(); solve(); System.out.println(res); } static void input() throws IOException { br = new BufferedReader(new InputStreamReader(S..
· Dev/PS
import java.io.*; import java.util.*; public class Main { static BufferedReader br; static StringTokenizer st; static String[] arr; static boolean[] checked; static int N, L; static StringBuilder minStr; static int min; public static void main(String[] args) throws IOException { input(); solve(); System.out.println(minStr); System.out.println(min); } static void input() throws IOException { br =..
· Dev/PS
import java.io.*; import java.util.*; public class Main { static BufferedReader br; static StringTokenizer st; static int A, T, F; public static void main(String[] args) throws IOException { input(); System.out.println(solve()); } static void input() throws IOException { br = new BufferedReader(new InputStreamReader(System.in)); A = Integer.parseInt(br.readLine()); T = Integer.parseInt(br.readLi..
· Dev/PS
import java.io.*; import java.util.*; public class DeleteBracket { static BufferedReader br; static StringBuilder sb; static Stack s; static List list; static int brckNum; static List res; static HashSet dup; public static void main(String[] args) throws IOException{ input(); searchBrck(); solve(0, ""); Collections.sort(res); for(int i = 0; i < res.size(); i++) { if(!dup.contains(res.get(i))) { ..
· Dev/PS
import java.io.*; import java.util.*; public class Laboratory { static int[] dx = {-1, 1, 0, 0}; static int[] dy = {0, 0, -1, 1}; static BufferedReader br; static StringTokenizer st; static int n, m; static int res = Integer.MIN_VALUE; static int[][] map, copyMap, virusMap; public static void main(String[] args) throws IOException{ input(); solve(0); System.out.println(res); } static void input(..
· Dev/PS
import java.io.*; import java.util.*; public class SalePizza { static BufferedReader br; static StringTokenizer st; static int orderNum, m, n, ans; static int[] mPizzaPieces, nPizzaPieces; static List left, right; public static void main(String[] args) throws IOException{ /* 1. 피자 A의 부분합을 구한다. 2. 피자 B의 부분합을 구한다. 3. 두 배열의 합 중 정답과 일치하는 것을 고른다. 유의할 점은 피자는 원형이기 때문에 부분합을 구할 때 신경써준다. */ input(); getSu..
· Dev/PS
import java.io.*; import java.util.*; public class Main { static BufferedReader br; static StringTokenizer st; static int n, s; static int[] arr; static List left; static List right; static long ans; public static void main(String[] args) throws IOException{ input(); dfs(left, arr.length/2, 0, 0); dfs(right, n, arr.length/2, 0); Collections.sort(left); Collections.sort(right); System.out.println..
· Dev/PS
import java.io.*; import java.util.*; class Point_1 { int x; int y; Point_1(int x, int y) { this.x = x; this.y = y; } } public class AlgoSpot { static int[] dx = {-1, 1, 0, 0}; static int[] dy = {0, 0, -1, 1}; static BufferedReader br; static StringTokenizer st; static int n, m; static int[][] board; static int[][] dp; public static void main(String[] args) throws IOException{ input(); System.ou..
· Dev/PS
import java.io.*; import java.util.*; class Floor { int num; int cnt; Floor(int num, int cnt) { this.num = num; this.cnt = cnt; } } public class StartLink { static BufferedReader br; static StringTokenizer st; static int f, s, g, u, d; static Floor ans; static boolean[] checked; public static void main(String[] args) throws IOException{ input(); bfs(); if(ans == null) System.out.println("use the..
· Dev/PS
import java.io.*; import java.util.*; class Rect { int x1; int y1; int x2; int y2; Rect(int x1, int y1, int x2, int y2) { this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; } } public class Logo { static BufferedReader br; static StringTokenizer st; static int n; static int ans; static boolean[] checked; static Rect[] rectArr; static Queue q; public static void main(String[] args) throws IO..
풋데브
'완전탐색' 태그의 글 목록 (3 Page)