태그>250p(총 22개의 글)
'250p' 관련 최근글
-
- 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
-
- 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
-
- 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
-
- 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
-
- Swimmers
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/08/30 12:19
Code public class Swimmers{ public int[] getSwimTimes(int[] distances, int[] speeds, int current) { int[] res = new int[distances.length]; for (int i=0; i < distances.length; i+) { if(distances[i] = 0) res[i] = 0;..
- Swimmers
-
- MineField
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/08/24 19:32
Code public class MineField{ public String[] getMineField(String mineLocations) { char[][] board = new char[9][9]; for (int i = 0; i < 9; i+) for (int j = 0; j < 9; j+) board[i][j] = '0'; for (int i = 1; i < mineLocations...
- MineField
-
- MissingLetters
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/05/31 16:56
Code import java.util.Arrays; public class MissingLetters{ public String getMissingLetters(String sentence) { sentence = sentence.toUpperCase(); String res = ""; for (char c = 'A'; c <= 'Z'; c+) if (sentence...
- MissingLetters
-
- ParallelSpeedup
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/05/31 16:04
Code public class ParallelSpeedup{ public int numProcessors(int k, int overhead) { int min = k; for (int num = 2, j = 0, d = 1; ; num+, j = d+) { int cycleTime = (k%num = 0) ? k/num : k/num+1; int total = cycleTime + (j+d..
- ParallelSpeedup
-
- Justifier
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/05/31 13:34
Code public class Justifier{ public String[] justify(String[] textIn) { int longest = 0; for (int i = 0; i < textIn.length; i+) if (textIn[i].length() > longest) longest = textIn[i].length(); for (int i = 0; i < textIn.length;..
- Justifier
-
- DivideByZero
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/05/29 06:24
Code import java.util.Arrays;import java.util.HashSet; public class DivideByZero{ public int CountNumbers(int[] numbers) { HashSet paper = new HashSet(); for (int i : numbers) paper.add(i); int old = 0; while (paper.si..
Topcoder, Easy, 250p, BruteForce, Math
- DivideByZero