태그>graphtheory(총 8개의 글)
'graphtheory' 관련 최근글
-
-
- PowerOutage
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2020/01/09 13:09
Code import java.util.LinkedList;import java.util.Queue; public class PowerOutage{ public int estimateTimeout(int[] fromJunction, int[] toJunction, int[] ductLength) { int n = fromJunction.length; int sum = 0; int len = 0; int..
- PowerOutage
-
- ShuffleMethod
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/10/04 18:35
Code public class ShuffleMethod{ int n; int[] ts; boolean[] flag; int[] sn; // selected number int[][] pn; // possible number boolean visit(int cnt) { for (int i = 0; i < n; i+) { if (flag[i+1]) continue; for (int j = 0; j < pn..
- ShuffleMethod
-
- UndergroundVault
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/08/04 03:39
Code 1import java.util.ArrayList; public class UndergroundVault{ int n; boolean canBeSealed(int[][] adj, boolean[] sealed, int room) { for (int k = 0; k < n; k+) ..
- UndergroundVault
-
- Rooms
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/06/03 02:33
Code public class Rooms { public int[] finalRooms(String[] rooms, String doors, int start) { int n = rooms.length; boolean[] pos = new boolean[n]; int[][][] nrooms = new int[n][91][]; for (int i = 0; i < n; i+) ..
- Rooms
-
- Circuits
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/03/03 14:15
Code public class Circuits{ public int howLong(String[] connects, String[] costs) { int N = connects.length; int cost[][] = new int[N][N]; for(int i=0; i<N; i+) if(!connects[i].equals("")) { String ..
- Circuits
-
- Escape
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2018/06/07 18:46
Code import java.util.LinkedList;public class Escape{ int[] dx = {1,0,-1,0}; int[] dy = {0,1,0,-1}; int[][] map, dist; boolean[][] used; class node { int x,y; node(int x, int y) { this.x = x; this.y = y; } } pub..
- Escape
-
- Kernighan-Lin algorithm (KL-Mincut)
-
양리와 함께하는 행복한 세상 by 양리|2010/11/24 14:00
Kernighan-Lin algorithm (KL-Mincut):• greedy procedure• swaps two subsets of equal cardinality in each pass• each pass consists of |V|/2 steps
- Kernighan-Lin algorithm (KL-Mincut)