백준 1865 웜홀 - JAVA
·
알고리즘/백준
1865 문제 링크https://www.acmicpc.net/problem/1865 문제 설명 입출력 코드123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172import java.io.*;import java.util.*; public class Main {    static Listint []> list;    static int N;    static int dist[];    private static final int INF = 500 * 10_000;        public static void main(S..
백준 1043 거짓말 - JAVA
·
알고리즘/백준
1043 문제 링크https://www.acmicpc.net/problem/1043 문제 설명 입출력 코드12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273import java.io.*;import java.util.*; public class Main {    static int[] parent;    static int find(int x) {        if(parent[x] == x) {            return x;        }        return parent[x] = find(pare..
백준 11404 플로이드 - JAVA
·
알고리즘/백준
11404 문제 링크https://www.acmicpc.net/problem/11404 문제 설명 입출력 코드12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576import java.util.*;import java.io.*; class Node implements ComparableNode> {    int target;    int weight;        Node(int target, int weight) {        this.target = target;        this.weight =..
백준 1504 특정한 최단 경로 - JAVA
·
알고리즘/백준
1504 문제 링크https://www.acmicpc.net/problem/1504 문제 설명 입출력 코드123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475import java.util.*;import java.io.*; class Node implements Comparable {    int target;    int weight;        Node(int target, int weight) {        this.target = target;        this.weight = weight; ..
백준 1916 최소비용 구하기 - JAVA
·
알고리즘/백준
문제 링크https://www.acmicpc.net/problem/1916 문제 설명 입출력 코드123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475import java.util.*;import java.io.*; class Node implements ComparableNode> {    int end;    int weight;        Node(int end, int weight) {        this.end = end;        this.weight = weight;    }        ..
백준 15686 치킨 배달 - JAVA
·
알고리즘/백준
15686 문제 링크https://www.acmicpc.net/problem/15686 문제 설명 입출력 코드123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960import java.io.*;import java.util.*; public class Main { static int N,M; static int result = Integer.MAX_VALUE; static int[][] arr; static boolean[] visit; static Listint[]> chiken = new ArrayList>(); static ..
백준 12865 평범한 배낭 - JAVA
·
알고리즘/백준
문제 링크https://www.acmicpc.net/problem/12865 문제 설명 입출력 코드1234567891011121314151617181920212223242526272829303132333435363738394041424344import java.io.*;import java.util.*; public class Main {    static int N;    static int K;    static Integer[][] dp;    static int w[];    static int v[];        public static void main(String[] args) throws IOException {        BufferedReader br = new BufferedRea..
백준 2805 나무자르기 - JAVA
·
알고리즘/백준
문제 링크https://www.acmicpc.net/problem/2805 문제 설명 입출력 코드123456789101112131415161718192021222324252627282930313233343536373839import java.util.*;import java.io.*;public class Main {    public static void main(String[] args) throws IOException {        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System..
백준 16928 뱀과 사다리 게임 - JAVA
·
알고리즘/백준
16928 문제 링크https://www.acmicpc.net/problem/16928 문제 설명 입출력 코드12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849import java.util.*;import java.io.*; public class Main {    static int N, M;    static Queue queue = new LinkedList();    static Integer[] visit;    static HashMap map = new HashMap();    public static void main(String[] args) throws IOException { ..
백준 1927 최소 힙 - JAVA
·
알고리즘/백준
1927 문제 링크https://www.acmicpc.net/problem/1927 문제 설명  입출력 코드1234567891011121314151617181920212223242526import java.io.*;import java.util.*; public class Main {    public static void main(String[] args) throws IOException {        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));         int..