목록목록 (214)
녕의 학습 기록

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ_13398_연속합2 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] a = new int[n]; int[] l = new int[n]; int[] r = new int[n]; i..

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BJ_10844_쉬운계단수 { static long M = 1000000000; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); long[][] d = new long[n+1][10]; int i, j; for (i=1; i

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BJ_11726_2xN타일링 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] d = new int[n+2]; d[1] = 1; d[2] = 2; for (int i=3; i

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BJ_2193_이친수 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); long[][] d = new long[n+1][2]; //d[i][0] : i번째의 0의 개수, d[i][1] : i번째의 1의 개수 d[1][0] = 0; d[1][1] = 1; f..

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ_14501_퇴사 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] t = new int[n + 1]; int[] p = new int[n + 1]; int[] result = ne..

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BJ_1463_1로만들기 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] d = new int[n+1]; d[1] = 0; for (int i=2; i

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BJ_1947_선물전달 { static long t = 1000000000; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); long[] d = new long[n+2]; //n=1 또는 2일 경우 아래 두줄에서 인덱스 에러. 따라서 n+2를 해줌 d[1] ..

거의 4시간 들여다본 문제.. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ_1256_사전 { public static void main(String[] args) throws IOException { StringBuilder result = new StringBuilder(); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLi..

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ_1722_순열의순서 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); boolean[] visited = new boolean[21]; //방문 배열 초기화 long[] f = new lon..

문제 상황모임 관리 프로젝트의 모임 관련 api를 개발하다가 다음과 같은 문제를 직면했다.1. 매번 club이 존재하는지 체크해주어야한다.2. 매번 로그인 유저가 이 club의 멤버인지 체크해주어야 한다.3. 매번 로그인 유저가 이 club의 관리자인지 체크해주어야 한다. (관리자 api인 경우)4. 매번 로그인 유저가 이 club에 가입 이후 처음 방문했는지 체크해주어야 한다. 클럽에 관련된 api마다 1, 2, 3, 4의 중복 코드가 발생한다. 해결방안중복되는 공통 관심사를 한번에 처리하고자 하였다.조금 찾아보니 필터, 스프링 인터셉터, AOP 로 공통관심사를 처리할 수 있었고,나는 스프링 인터셉터(Spring Interceptor)를 사용하여 이번 문제를 해결하고자 하였다. 스프링 인터셉터란 ?스..