목록2025/02/13 (3)
넘치게 채우기
https://codeforces.com/contest/2067/problem/CCodeforces Round 1004(Div.2) - C. Devyatkino문제 유형: 수학, 그리디, 탐색, 브루트 포스시간 제한: 2초메모리 제한: 256MB 문제You are given a positive integer n">n. In one operation, you can add to n">n any positive integer whose decimal representation contains only the digit 9">9, possibly repeated several times.What is the minimum number of operations needed to make the number n"..
https://www.acmicpc.net/problem/11505BOJ - 구간 곱 구하기문제 유형: 세그먼트 트리문제 난이도: Gold I시간 제한: 1초메모리 제한: 256MB 문제어떤 N개의 수가 주어져 있다. 그런데 중간에 수의 변경이 빈번히 일어나고 그 중간에 어떤 부분의 곱을 구하려 한다. 만약에 1, 2, 3, 4, 5 라는 수가 있고, 3번째 수를 6으로 바꾸고 2번째부터 5번째까지 곱을 구하라고 한다면 240을 출력하면 되는 것이다. 그리고 그 상태에서 다섯 번째 수를 2로 바꾸고 3번째부터 5번째까지 곱을 구하라고 한다면 48이 될 것이다. 입력첫째 줄에 수의 개수 N(1 ≤ N ≤ 1,000,000)과 M(1 ≤ M ≤ 10,000), K(1 ≤ K ≤ 10,000) 가 주어진다. ..
https://leetcode.com/problems/minimum-operations-to-exceed-threshold-value-ii/description/leetcode - Minimum Operations to Exceed Threshold Value II문제 유형: 우선순위 큐, 힙, 그리디문제 난이도: Medium 문제You are given a 0-indexed integer array nums, and an integer k.In one operation, you will:Take the two smallest integers x and y in nums.Remove x and y from nums.Add min(x, y) * 2 + max(x, y) anywhere in the arra..