목록2025/02/14 (3)
넘치게 채우기
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..