태그>easy(총 67개의 글)
'easy' 관련 최근글
-
- 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
-
- GoldenChain
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2021/01/12 06:32
Problem 다양한 길이의 금사슬을 연결해 목걸이를 만들어야 한다. 연결시키려면, 한 사슬의 끝쪽 고리의 일부를 절단하고 이를 다른 사슬의 끝 고리에 연결하면 된다. 고리를 절단하는 횟수를 최소화해서 목걸..
- GoldenChain
-
- 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
-
- 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
-
- 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
-
- RepeatedSubstrings
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/12/02 10:28
Code public class RepeatedSubstrings{ public String decompress(String compressed) { String[] sp = compressed.split("s*[^0-9]+s*"); int[] p1 = new int[sp.length/2]; int[] p2 = new int[sp.length/2]; in..
- RepeatedSubstrings
-
- T9Input
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/11/27 10:30
Code import java.util.Arrays;import java.util.HashMap;import java.util.TreeSet; public class T9Input { public String[] getKeypresses(String[] messages) { HashMap map = new HashMap(); HashMap dict = new HashMap()..
- T9Input
-
- WordForm
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/11/24 21:13
Code public class WordForm { // The problem name is Stemmer. public String getSequence(String word) { word = word.toUpperCase(); char c = word.charAt(0); String res = (c='A' || c='E' || c='I' || c='O' || c='U') ? "V&qu..
- WordForm
-
- SkipRope
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/11/21 07:56
Code import java.util.Arrays; public class SkipRope{ public int[] partners(int[] candidates, int height) { Arrays.sort(candidates); int[] res = new int[2]; int best = 201; for (int i = 0; i < candidates.length-1; i+) { if (..
- SkipRope
-
- 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
-
- AustrianLotto
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/11/09 17:55
Codepublic class AustrianLotto{ public int[] evaluate(String drawing, String[] picks) { boolean[] n = new boolean[46]; String[] sp = drawing.split(" "); for (int i=0; i < 6; i+) n[Integer.parseInt(sp[i]..
- AustrianLotto
-
- WhichData
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/11/02 09:16
Code import java.util.ArrayList;import java.util.Arrays; public class WhichData{ public int[] bestVariance(int[] sampleData, int varNum, int varDen) { Arrays.sort(sampleData); int sdLen = sampleData.length; double var ..
Topcoder, Easy, 300p, BruteForce, Math
- WhichData
-
- 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