Dev/PS

· Dev/PS
import java.io.*; import java.util.*; class Node { int num; int cnt; Node(int num, int cnt) { this.num = num; this.cnt = cnt; } } public class HideAndSeek { static BufferedReader br; static StringTokenizer st; static int N, K; static int ans; static boolean[] checked; public static void main(String[] args) throws IOException{ input(); solve(); System.out.println(ans); } public static void input(..
· Dev/PS
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class TSP { static BufferedReader br; static StringTokenizer st; static int N; static int[][] W; static int ans = Integer.MAX_VALUE; public static void main(String[] args) throws IOException{ input(); solve(); System.out.println(ans); } public static void input() ..
· Dev/PS
import java.io.*; import java.util.*; public class DivisionSquare { static BufferedReader br; static StringTokenizer st; static int N, M; static int[][] arr; static long[][] sum; static long ans = -1; public static void main(String[] args) throws IOException{ input(); solve(); System.out.println(ans); } public static void input() throws IOException { br = new BufferedReader(new InputStreamReader..
· Dev/PS
import java.io.*; import java.util.StringTokenizer; public class RemoteController { static BufferedReader br; static StringTokenizer st; static String N; static int cnt; static String[] buttons; static int ans = 0; public static void main(String[] args) throws IOException{ input(); solve(); System.out.println(ans); } public static void input() throws IOException { br = new BufferedReader(new Inp..
· Dev/PS
import java.io.*; import java.util.*; public class Main { static BufferedReader br; static int N; static int[] ans; static boolean isFirst = false; public static void backtracking(int[] arr, int depth) { if(depth > 1) { if(!isBadSequence(arr, depth)) return; } if(depth == N) { for(int i = 0; i ans[i]) break; if(arr[i] < ans[i]) { for(int j = 0; j < N; j++) { ans[j] = arr[..
· Dev/PS
import java.io.*; import java.util.*; public class Main { static BufferedReader br; static int N; static int[] A; static char[] operators; static int plus, minus, multiply, divide; static int max = Integer.MIN_VALUE, min = Integer.MAX_VALUE; static int sum = 0; public static void input() throws IOException { br = new BufferedReader(new InputStreamReader(System.in)); N = Integer.parseInt(br.readL..
· Dev/PS
import java.io.*; import java.util.StringTokenizer; public class Main { static BufferedReader br; static int N; static int ans = Integer.MAX_VALUE; static int[] start; static int[] link; static int startSum = 0; static int linkSum = 0; static boolean[] picked; static int[][] abilityMap; public static void solve(int[] start, int[] link, boolean[] picked, int depth, int idx) { if(depth == N/2) { i..
· Dev/PS
import java.io.*; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { static int N; static int ans = 0; static StringTokenizer st; public static void recur(int[] A, int depth, int n) { //종료조건 if(depth == N) { ans = Math.max(ans, calculate(A, n)); return; } //재귀호출 for(int i = depth; i < N; i++) { swap(A, i ,depth); recur(A, depth+1, n); swap(A, i, depth); } } p..
· Dev/PS
import java.io.*; import java.util.*; public class Main { static int N; static int S; static int ans = 0; static int[] arr; static StringTokenizer st; public static void backtracking(int idx, int sum) { if(idx == N) { if(sum == S) { ans++; } return; } backtracking(idx+1, sum); backtracking(idx+1, sum+arr[idx]); } public static void main(String[] args) throws IOException{ BufferedReader br = new ..
· Dev/PS
import java.io.*; import java.math.BigDecimal; import java.math.BigInteger; import java.util.StringTokenizer; public class Main { static int T; static int a; static int b; static StringBuilder sb; public static int calculate() { int ans = 1; for(int i = 0; i < b; i++) { ans = (ans*a) % 10; } if(ans == 0) { return 10; } return ans; } public static void main(String[] args) throws IOException { Buf..
풋데브
'Dev/PS' 카테고리의 글 목록 (7 Page)