태그>1000p(총 9개의 글)
'1000p' 관련 최근글
-
- BridgeCrossing
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2020/03/19 14:25
Code import java.util.Arrays; public class BridgeCrossing{ int n, min; boolean[] a; int[] times; void go(int t, int num) { for (int i = 0; i < n; i+) { if (!a[i]) continue; a[i] = false; for (int j = i+1; j < n; j+) { if (!a[j]..
- BridgeCrossing
-
- HillHike
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2020/03/10 23:00
Code public class HillHike{ public long numPaths(int distance, int maxHeight, int[] _landmarks) { long[][][] cache1 = new long[2][52][51]; long[][][] cache2 = new long[2][52][51]; cache1[0][0][0] = 1; i..
- HillHike
-
- SetComparison
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/11/17 20:29
Code import java.util.HashSet;import java.util.TreeSet;import java.util.StringTokenizer; public class SetComparison{ HashSet getSet(StringTokenizer st) { HashSet s = new HashSet(); String t = st.nextToken(); while (!t...
- SetComparison
-
- 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
-
- Planets
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/06/20 01:23
Code import java.text.DecimalFormat; public class Planets{ public String[] locations(String[] planets, int time) { double G = 6.673E-11; double t = 3600; int n = planets.length; double[] f = new double[3]; double[] m = new..
- Planets
-
- GasStations
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/03/10 00:42
Code public class GasStations{ public double tripCost(int[] dist, int[] price, int _mpg, int tankSize, int tripLength) { if(_mpg*tankSize >= tripLength) return 0; int N = dist.length, lowerPrice=20001, idx=0; double lowes..
- GasStations
-
- PickTeam
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/02/28 14:14
Code import java.util.Arrays; public class PickTeam{ int n, bestSum; int[] team; int[][] nums; String[] names, bestTeam; void recur(int idx, int size) { if(size = team.length) { int sum=0; for(int i=0; i < team.length; ..
- PickTeam
-
- PossibleOrders
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2018/06/21 16:44
Code public class PossibleOrders{ int N; long sum; long comb(long n, long r) { long denom=1, numer=1; while (r > 0) {denom *= n-; numer *= r-;} return denom / numer; } void calcul(long[] cnt, int rem, int min) { for (..
- PossibleOrders