TOPCODER

Category
아이템: TOPCOD(14)
포스트 갯수14

Masterbrain

By 불타는 아잍(IT)스크림 | 2020년 4월 1일 | 
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[i] = true; up[i] = true; } } for (int i = 0; i < 4; i++

BridgeCrossing

By 불타는 아잍(IT)스크림 | 2020년 3월 19일 | 
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]) continue; a[j] = false; if (num==2 && t+time

RectangularGrid

By 불타는 아잍(IT)스크림 | 2020년 3월 14일 | 
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 res; }} Problem 격자 무늬에서 직사각형의 개수를 구하라. (정사각형 제외) 예) 3x3 격자에서 1

HillHike

By 불타는 아잍(IT)스크림 | 2020년 3월 10일 | 
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; int[] landmarks = new int[_landmarks.length+1]; System.arraycopy(_landmarks,0,landmarks,0,_landmarks.length); landmarks[_landmarks.length] = -1;