일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- 부하 테스트
- login
- hashmap
- kakao
- Sharding
- java
- 코딩테스트
- dip
- Redis
- pub.dev
- 코딩 테스트
- c
- AOP
- Scaffold
- 코드트리
- 운영체제
- flutter
- 연습문제
- 코딩
- 코드 트리
- thread
- Spring
- Kotlin
- nGrinder
- C언어
- OAuth
- 자료구조
- Kafka
- Oidc
- exception
- Today
- Total
목록java (17)
Nick Dev
문제 링크https://www.codetree.ai/trails/complete/curated-cards/challenge-max-movements-with-direction/description Code Tree | Learning to Code with ConfidenceA super-comprehensive, meticulously arranged Coding Learning Curriculum engineered by Algorithm Experts composed of former International Olympiad in Informatics (IOI) medalists.www.codetree.ai 내 풀이import java.util.*;import java.io.*;public clas..
문제링크https://www.codetree.ai/trails/complete/curated-cards/challenge-yutnori-1d/description Code Tree | Learning to Code with ConfidenceA super-comprehensive, meticulously arranged Coding Learning Curriculum engineered by Algorithm Experts composed of former International Olympiad in Informatics (IOI) medalists.www.codetree.ai 내 풀이import java.util.*;public class Main { static int n; static ..
문제 링크[https://www.codetree.ai/trails/complete/curated-cards/test-calculations-with-alphabet/description]내 풀이import java.util.*;public class Main { static char[] input; static int size; static int max = Integer.MIN_VALUE; static Map map; static Set alph; static List list; // 알파벳에 숫자 매핑하기 static void recur(int idx) { if (idx == size) { int res = calcul..
문제 링크https://www.codetree.ai/missions/2/problems/strong-explosion?&utm_source=clipboard&utm_medium=text내 코드import java.util.*;import java.io.*;public class Main { // 폭탄 위치를 저장할 클래스 static class Point { int x; int y; Point(int x, int y) { this.x = x; this.y = y; } } // 2번 타입 폭탄용 dx, dy static int[] dxs = new int[] {1, 0, -1, 0}; ..
문제 링크https://www.codetree.ai/missions/2/problems/beautiful-number?&utm_source=clipboard&utm_medium=text내 코드import java.util.*;public class Main { static int n; static int ans = 0; static ArrayList list; static boolean isBeautilful() { for (int i = 0; i (); makeNum(0); System.out.println(ans); }}설명재귀함수를 통해서 1~4 숫자로 만든 n자리 수를 만든다각 숫자에 대해서 아름다운지 판단한다makeNum()가능한 ..
문제문제 링크https://www.codetree.ai/missions/2/problems/best-cross-shape-bomb?&utm_source=clipboard&utm_medium=text내 코드import java.util.*;public class Main { static int n; static int arr[][]; static int copy[][]; static int[] dxs = new int[] {1, 0, -1, 0}; static int[] dys = new int[] {0, 1, 0, -1}; public static void copy() { for (int i = 0; i = 0; i--) { if (..

문제문제 링크https://www.codetree.ai/missions/2/problems/one-trial-of-2048-game?&utm_source=clipboard&utm_medium=text내 코드import java.util.*;import java.io.*;public class Main { public static void main(String[] args) throws IOException { // 여기에 코드를 작성해주세요. BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; int[][] grid = new int[..

문제문제 링크https://www.codetree.ai/missions/2/problems/The-1D-bomb-game?&utm_source=clipboard&utm_medium=text내 코드import java.util.*;import java.io.*;public class Main { static int endOfArray; static int[] arr; static int n; static int m; public static void bomb() { int[] tmp = new int[n]; int tmpIdx = 0; // 옮겨 담을 배열의 인덱스 int arrIdx = 0; // 현재 배열의 인덱스 ..

문제문제 링크https://www.codetree.ai/missions/2/problems/The-2D-wind-blows?&utm_source=clipboard&utm_medium=text내 코드import java.util.*;import java.io.*;public class Main { static int n; static int m; static int[][] grid; static int r1; static int c1; static int r2; static int c2; public static void main(String[] args) throws IOException { // 여기에 코드를 작성해주세요. Buffe..
CAS가 뭐야?Compare-And-Swap의 약어로, 멀티 쓰레드 환경에서 발생하는 동기화 문제를 해결하기 위한 알고리즘-** 현재 쓰레드에 저장된 값과 **메인 메모리에 저장된 값을 비교해서 일치하는 경우, 새로운 값으로 교체하고, 일치하지 않으면 재시도 진행위 과정이 하드웨어적으로 atomic하게 구현되어야 함CAS 목적결국 해당 변수에 대해서 동시에 딱 하나의 쓰레드만 값을 수정할 수 있게 함으로써 synchronized 또는 lock 을 사용하지 않고 동기화 문제(race condition)을 해결할 수 있다.CAS 동작 방식CAS 알고리즘을 위한 3가지 변수바꾸려는 변수바꾸려는 변수의 기댓값업데이트 할 값CAS 동작 방식package java.util.concurrent.atomic;publi..