728x90
반응형
Moo 게임 boj 5904
https://www.acmicpc.net/problem/5904
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Boj5904 {
public char solution() throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(reader.readLine());
int length = 3;
int reps = 0;
while (length < n) {
reps++;
length = length * 2 + (reps + 3);
System.out.println(length);
}
n--;
while (true) {
int midIndex = (length - (reps - 3)) / 2;
int lastIndex = (length - (reps + 3)) / 2 + (reps + 3);
if (n == midIndex) return 'm';
else if (midIndex < n && n < lastIndex) return 'o';
else if (n > lastIndex) {
n -= lastIndex;
length -= lastIndex;
} else {
length -= reps + 3;
length -= midIndex;
}
reps--;
}
}
public static void main(String[] args) throws IOException {
System.out.println(new Boj5904().solution());
}
}
데이터베이스 정규화
제 1 정규형
하나의 컬럼이 복수의 데이터를 가지고 있지 않아야 한다.
제 2 정규형
기본키에 종속되지 않는 컬럼은 테이블에서 분리되어야 한다.
제 3 정규형
기본키가 아닌 다른 컬럼에 종속성을 갖는 컬럼들은 별도로 분리해야 한다.
728x90
반응형
'멋쟁이 사자처럼 > TIL' 카테고리의 다른 글
230724 15주 1일차 TIL. JavaScript, 변수, hoisting, 연산자 (0) | 2023.07.24 |
---|---|
230718 14주 2일차 TIL. Entity 관계 설정 (0) | 2023.07.19 |
230713 13주 4일차 TIL. 카드 합체 놀이 boj 15903, WebSocket (0) | 2023.07.13 |
230712 13주 3일차 TIL. Heap, Job Queue (0) | 2023.07.13 |
230711 13주 2일차 TIL. 쿼드트리, 퀵소트, 이진탐색 (0) | 2023.07.11 |