PostAddsense


태그 : Dynamicprogramming 요약보기전체보기목록닫기

1

HillHike

Codepublic class HillHike{    public long numPaths(int distance, int maxHeight, int[] _landmarks) {        long[][][] cache1 = new long[2]...

PossibleOrders

Codepublic class PossibleOrders{    int N;    long sum;    long comb(long n, long r) {        long denom=1, numer=1;        whil...

SkewTree

Codepublic class SkewTree{    int[] probs;    int[][] best;    int getAccess(int i1, int i2) {        int total=0;        for (i...

GreedyChange

Codeimport java.util.Arrays;public class GreedyChange{    public int smallest(int[] denoms) {        Arrays.sort(denoms);   ...

Robot

Codepublic class Robot {    static int[] dx = {-1,  0,  1,-1, 1, -1, 0, 1 };    static int[] dy = {-1, -1, -1, 0, 0,  1, 1, 1 };    public int getProb(St...

Champagne

Codepublic class Champagne{    public String howMuch(int height, int glass, int units) {        int B = 1 << height-1;        int i=0,j=0,n,d;...
1