목록2025/01/21 (2)
넘치게 채우기
https://www.acmicpc.net/problem/1509BOJ - 팰린드롬 분할문제 유형: 팰린드롬, 문자열 처리, 다이나믹 프로그래밍문제 난이도: Gold I시간 제한: 2초메모리 제한: 128MB 문제세준이는 어떤 문자열을 팰린드롬으로 분할하려고 한다. 예를 들어, ABACABA를 팰린드롬으로 분할하면, {A, B, A, C, A, B, A}, {A, BACAB, A}, {ABA, C, ABA}, {ABACABA}등이 있다.분할의 개수의 최솟값을 출력하는 프로그램을 작성하시오. 입력첫째 줄에 문자열이 주어진다. 이 문자열은 알파벳 대문자로만 이루어져 있고, 최대 길이는 2,500이다. 출력첫째 줄에 팰린드롬 분할의 개수의 최솟값을 출력한다. 풀이isPalindrome[l][r] = [l, r..
https://leetcode.com/problems/grid-game/description/leetcode - Grid Game문제 유형: 부분합, 구간합, 그리디문제 난이도: Medium 문제You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r, c) on the matrix. Two robots are playing a game on this matrix.Both robots initially start at (0, 0) and want to reach (1, n-1). Each robot may only move to the right ((..