태그>topcoder(총 77개의 글)
'topcoder' 관련 최근글
-
- ChristmasBatteries
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2021/02/07 05:47
Problem 건전지를 넣어 동작하는 장난감이 있다. 장난감은 총 N개, 건전지는 총 N개다. 장난감 번호는 0에서 N-1이고, i번 장난감은 (i mod 5)개 건전지를 필요로 한다. i번 장난감이 주는 즐거움(fun)의 양은 ((X*i*i + Y*i + Z) mod M)이다. 건전지 N개를 사용해 ..
Topcoder, SRM796, Easy, 250p, BruteForce
- ChristmasBatteries
-
- Flags
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2021/01/20 00:11
Problem 주어진 색으로 칠해진 세로줄을 가진 깃발을 설계해야 한다. 같은 색을 가진 줄들은 서로 인접할 수 없으며, 인접하면 안되는 색의 번호가 오름차순 forbidden 배열로 주어진다. 줄을 가장 적게 사용해 깃발을 ..
- Flags
-
- GoldenChain
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2021/01/12 06:32
Problem 다양한 길이의 금사슬을 연결해 목걸이를 만들어야 한다. 연결시키려면, 한 사슬의 끝쪽 고리의 일부를 절단하고 이를 다른 사슬의 끝 고리에 연결하면 된다. 고리를 절단하는 횟수를 최소화해서 목걸..
- GoldenChain
-
- Masterbrain
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2020/04/02 06:30
Code public class Masterbrain { String score(String g, String p) { int b = 0, w = 0; boolean[] ug = new boolean[4]; boolean[] up = new boolean[4]; for (int i = 0; i < 4; i+) { if (g.charAt(i)=p.charAt(i)) { b+; ug[..
Topcoder, SRM146, Hard, 600p, BruteForce
- Masterbrain
-
- 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
-
- RectangularGrid
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2020/03/15 02:32
Code public class RectangularGrid{ public long countRectangles(int width, int height) { long res = 0; for(int i = 0; i < height; i+) { for(int j = 0; j < width; j+) { if(i = j) continue; res = (height-i) * (width-j); } } return ..
- RectangularGrid
-
- 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
-
- Bonuses
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2020/03/02 15:53
Code public class Bonuses{ public int[] getDivision(int[] points) { int len = points.length; int sum = 0, extra = 100; boolean[] used = new boolean[len]; int[] percents = new int[len]; for (int i = 0; i < len; i+) sum ..
Topcoder, SRM145, Easy, 250p, SimpleMath
- Bonuses
-
- VendingMachine
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2020/02/28 15:13
Code public class VendingMachine{ int rows, cols; int ts; // a total of seconds int ci, cj; // current i, current j; int[][] p; void addSecs(int nj) { int a = Math.abs(nj - cj); int b = cols - Math.abs(nj - cj); ts = (a < b) ? a ..
- VendingMachine
-
-
- Lottery
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2020/01/16 11:38
Code import java.util.Arrays;import java.util.Comparator; public class Lottery{ long perm(long a, long b) { long num = 1; for (int i = 0; i < b; i+) num *= a-; return num; } long fact(long a) { long num = 1; for (int i = 2; i <= a;..
- Lottery
-
- 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
-
- ArithmeticSequenceDiv1
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/12/21 05:36
Code public class ArithmeticSequenceDiv1 { public int findMinCost(int[] x) { int n = x.length; int min = 10000; int maxGap = 0; for (int i = 0; i < n-1; i+) if(Math.abs(x[i+1]-x[i]) > maxGap) maxGap = Math.abs(x[i+1..
Topcoder, Easy, 250p, Search, SimpleMath
- ArithmeticSequenceDiv1
-
- TreasureHunt
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/12/20 20:40
Code public class TreasureHunt{ int xLen,yLen; char[][] land; String[] inst; boolean instCheck(int x, int y) { int[] dx = {0,-1,1,0}; int[] dy = {-1,0,0,1}; fo..
- TreasureHunt