목록2025/02 (38)
넘치게 채우기
https://www.acmicpc.net/problem/6968BOJ - Lottery문제 유형: 문자열 처리, 그리디, 문자열 파싱, 구현문제 난이도: Gold III시간 제한: 1초메모리 제한: 128MB 문제You have just won the lottery. All that separates you from your multi-million dollar prize is your correct answer to the following skill-testing question: 1234+4567×11In your twenty seconds you see your fortune slipping away because you don't know whether the answer is (1234+4..
https://leetcode.com/problems/find-the-punishment-number-of-an-integer/leetcode - FInd the Punishment Number of an Integer문제 유형: 백트래킹문제 난이도: Medium 문제Given a positive integer n, return the punishment number of n.The punishment number of n is defined as the sum of the squares of all integers i such that:1 The decimal representation of i * i can be partitioned into contiguous substrings such that ..
https://codeforces.com/contest/2067/problem/DCodeforces Round 1004(Div.2)] - D. Obejct Identification문제 유형: 그래프, 생성형, 인터랙티브시간 제한: 2초메모리 제한: 256MB 문제This is an interactive problem.You are given an array x1,…,xn">x1,…,xn of integers from 1">1 to n">n. The jury also has a fixed but hidden array y1,…,yn">y1,…,yn of integers from 1">1 to n">n. The elements of array y">y are unknown to y..
https://www.acmicpc.net/problem/32984BOJ - 겨울이 좋아문제 유형: 이진탐색, 매개변수 탐색문제 난이도: Gold III시간 제한: 1초메모리 제한: 1024MB 문제정우는 겨울을 너무 좋아한다. 하지만 아쉽게도 지금은 가을이다. 정우가 사는 도시에는 N그루의 나무가 있고 A번째 나무에는 A_i개의 나뭇잎이 붙어있다. i번째 나무의 나뭇잎은 하루에 Bi개씩 떨어지며, Bi개보다 적게 남아있을 경우에는 전부 떨어진다. 정우는 N그루의 나무에 있는 모든 나뭇잎이 떨어진 날부터를 겨울이라고 부른다.정우는 특별한 능력을 가지고 있는데, 매일 하나의 나무를 선택해서 그날에 나뭇잎이 2배로 떨어지게 만들 수 있다. 다시 말해서 정우가 i번째 나무를 선택해서 능력을 사용하면 그날 그 ..
https://leetcode.com/problems/product-of-the-last-k-numbers/description/Product of the Last K Numbers문제 유형: 부분합, 슬라이딩 윈도우문제 난이도: Medium 문제Design an algorithm that accepts a stream of integers and retrieves the product of the last k integers of the stream.Implement the ProductOfNumbers class:ProductOfNumbers() Initializes the object with an empty stream.void add(int num) Appends the integer num t..
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..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/sZhh1/btsMeyKMQzf/Ux2TUMnG8A7xpvyl1JNT7k/img.png)
https://www.acmicpc.net/problem/25279BOJ - Treehouse문제 유형: 기하학, 수학, 해시문제 난이도: Gold III시간 제한: 3초메모리 제한: 1024MB 문제Pusheen wants to build a treehouse in the Treehouse forest in Brunnshög in the north of Lund. The treehouse should to be built on a square platform in the treetops, with a tree in each of the four corners. When Pusheen has picked a spot to built the treehouse, trees that are located be..
https://leetcode.com/problems/max-sum-of-a-pair-with-equal-sum-of-digits/description/leetcode - Max Sum of a Pair With Equal Sum of Digits문제 유형: 해시, 그리디문제 난이도: Medium 문제You are given a 0-indexed array nums consisting of positive integers. You can choose two indices i and j, such that i != j, and the sum of digits of the number nums[i] is equal to that of nums[j].Return the maximum value of nums[..