목록2024/10/26 (3)
넘치게 채우기
https://codeforces.com/contest/2033/problem/ACodeforces Round 981(DIv.3) - A. Sakurako and Kosuke문제 유형: 수학, 구현시간 제한: 1초메모리 제한: 256MB 문제Sakurako and Kosuke decided to play some games with a dot on a coordinate line. The dot is currently located in position x=0">x=0. They will be taking turns, and Sakurako will be the one to start.On the i">i-th move, the current player will move the dot in some d..
https://www.acmicpc.net/problem/1149BOJ - RGB거리문제 유형: 다이나믹 프로그래밍(dp)문제 난이도: Silver I시간 제한: 0.5초메모리 제한: 128MB 문제RGB거리에는 집이 N개 있다. 거리는 선분으로 나타낼 수 있고, 1번 집부터 N번 집이 순서대로 있다.집은 빨강, 초록, 파랑 중 하나의 색으로 칠해야 한다. 각각의 집을 빨강, 초록, 파랑으로 칠하는 비용이 주어졌을 때, 아래 규칙을 만족하면서 모든 집을 칠하는 비용의 최솟값을 구해보자.1번 집의 색은 2번 집의 색과 같지 않아야 한다.N번 집의 색은 N-1번 집의 색과 같지 않아야 한다.i(2 ≤ i ≤ N-1)번 집의 색은 i-1번, i+1번 집의 색과 같지 않아야 한다.입력첫째 줄에 집의 수 N(2 ..
https://leetcode.com/problems/height-of-binary-tree-after-subtree-removal-queries/description/?envType=daily-question&envId=2024-10-26leetcode - Height of Binary Tree After Subtree Removal Queries문제 유형: 재귀, dfs, 다이나믹 프로그래밍문제 난이도: Hard 문제You are given the root of a binary tree with n nodes. Each node is assigned a unique value from 1 to n. You are also given an array queries of size m.You have to..