목록Problem Solving (223)
Life Engineering
https://www.acmicpc.net/problem/11054 11054번: 가장 긴 바이토닉 부분 수열 첫째 줄에 수열 A의 크기 N이 주어지고, 둘째 줄에는 수열 A를 이루고 있는 Ai가 주어진다. (1 ≤ N ≤ 1,000, 1 ≤ Ai ≤ 1,000) www.acmicpc.net import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main_BOJ_11054 { static int N; static int[] arr; static int[] dp_up; static int[] dp_down; pub..
https://www.acmicpc.net/problem/1043 1043번: 거짓말 지민이는 파티에 가서 이야기 하는 것을 좋아한다. 파티에 갈 때마다, 지민이는 지민이가 가장 좋아하는 이야기를 한다. 지민이는 그 이야기를 말할 때, 있는 그대로 진실로 말하거나 엄청나게 www.acmicpc.net import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; public class Main { static List[] adjList=new Array..
https://www.acmicpc.net/problem/17836 17836번: 공주님을 구해라! 용사는 마왕이 숨겨놓은 공주님을 구하기 위해 (N, M) 크기의 성 입구 (1,1)으로 들어왔다. 마왕은 용사가 공주를 찾지 못하도록 성의 여러 군데 마법 벽을 세워놓았다. 용사는 현재의 가지고 있는 www.acmicpc.net import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class Main_BOJ_17836 { stat..
https://programmers.co.kr/learn/courses/30/lessons/49994# 코딩테스트 연습 - 방문 길이 programmers.co.kr class Solution { static boolean[][][] board=new boolean[11][11][4]; static int[] dy={-1,1,0,0}; static int[] dx={0,0,1,-1}; public int solution(String dirs) { int answer = 0; int y=5, x=5; for (int i=0; i (y,x) 위치에서 d방향으로 길을 간 적이 있는지 표시 각 움직이는 방향에 따라, 출발점과 도착점 위치 모두 board[y][x][d] 표시를 해둬서 갔던 길 표시를 한다. 처음..