태그>easy(총 67개의 글)
'easy' 관련 최근글
-
- WaterPressure
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/09/09 01:56
Code import java.util.ArrayList; public class WaterPressure{ int[] dy = {-1,0,1,0}; int[] dx = {0,1,0,-1}; class Point { int x,y; Point(int x, int y) { this.x = x; this.y = y; } } public int howLong(String[] layout) { int..
Topcoder, Easy, Simulation, 500p, BFS
- WaterPressure
-
- 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
-
- 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
-
- ResistorCombinations
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/07/10 14:27
Code import java.util.ArrayList;import java.util.HashSet; public class ResistorCombinations{ double t, closest, res; ArrayList getSet(ArrayList copy, int idx, int n, int size) { ArrayList S = new ArrayList(); for (int i = idx; i &l..
Topcoder, Easy, 500p, BruteForce, 조합
- ResistorCombinations
-
- 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
-
-
- Mandelbrot
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/06/14 18:52
Code public class Mandelbrot{ public int iterations(int max, double a, double b) { double za = a, zb = b; for (int i=0; i <= max; i+) { if (za*za+zb*zb > 4) return i; double a2 = za*za - zb*zb + a; double b2 = 2*za*zb + ..
Topcoder, Easy, 450p, Math, Simulation
- Mandelbrot
-
- BitmapToGraph
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/06/12 21:37
Code import java.util.TreeSet; public class BitmapToGraph{ int[] dx = {-1,0,1,1,1,0,-1,-1}; int[] dy = {-1,-1,-1,0,1,1,1,0}; int n,m; String[] bmap; char check(int nx, int ny) { return (nx<0 || nx>=m || ny<0 |..
- BitmapToGraph
-
- Rooms
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/06/03 02:33
Code public class Rooms { public int[] finalRooms(String[] rooms, String doors, int start) { int n = rooms.length; boolean[] pos = new boolean[n]; int[][][] nrooms = new int[n][91][]; for (int i = 0; i < n; i+) ..
- Rooms
-
- 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
-
- UserId
-
불타는 아잍(IT)스크림 by 불타는 아이스크림|2019/05/29 18:50
Code public class UserId{ String[] iu; String delch(String s) { return s.replace(" ","").replace("'",""); } boolean chkNotInUse(String s) { for (int i=0; i < iu.length; i+) i..
- UserId
-
- 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