목록2024/09 (43)
넘치게 채우기
https://leetcode.com/problems/design-a-stack-with-increment-operation/description/?envType=daily-question&envId=2024-09-30leetcode - Design a Stack With Increment Operation문제 유형 : 구현, 스택문제 난이도 : Medium 문제Design a stack that supports increment operations on its elements.Implement the CustomStack class:CustomStack(int maxSize) Initializes the object with maxSize which is the maximum number of elem..
https://leetcode.com/problems/all-oone-data-structure/description/?envType=daily-question&envId=2024-09-29leetcode - All O'one Data Structure문제 유형 : 해시, 구현문제 난이도 : Hard 문제Design a data structure to store the strings' count with the ability to return the strings with minimum and maximum counts.Implement the AllOne class:AllOne() Initializes the object of the data structure.inc(String key) Increme..
https://codeforces.com/contest/2013/problem/CCodeforces Round 973(Div. 2) - C. Password Cracking문제 유형 : 구현제한 시간: 2초제한 메모리: 256MB 문제Dimash learned that Mansur wrote something very unpleasant about him to a friend, so he decided to find out his password at all costs and discover what exactly he wrote.Believing in the strength of his password, Mansur stated that his password — is a binary string of..
https://leetcode.com/problems/design-circular-deque/description/?envType=daily-question&envId=2024-09-28leetcode - Design Circular Deque문제 유형 : 데크, 큐, 스택, 구현문제 난이도 : Medium 문제Design your implementation of the circular double-ended queue (deque).Implement the MyCircularDeque class:MyCircularDeque(int k) Initializes the deque with a maximum size of k.boolean insertFront() Adds an item at the front..
https://leetcode.com/problems/my-calendar-ii/description/?envType=daily-question&envId=2024-09-27leetcode - My Calendar II문제 유형 : 구현, 라인 스위핑문제 난이도 : Medium 문제You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a triple booking.A triple booking happens when three events have some non-empty intersection (i.e., some moment is common to a..
https://codeforces.com/contest/2013/problem/BCodeforces Round 973(Div. 2) - B. Battle for Survive문제 유형 : 그리디제한 시간: 1초제한 메모리: 256MB 문제Eralim, being the mafia boss, manages a group of n">𝑛n fighters. Fighter i">𝑖i has a rating of ai">𝑎𝑖ai.Eralim arranges a tournament of n−1">𝑛−1n−1 battles, in each of which two not yet eliminated fighters i">𝑖i and j">𝑗j (1≤i<j≤n">1≤..
https://www.acmicpc.net/problem/25342BOJ - 최대 최소공배수문제 유형: 정수론, 수학, 그리디문제 난이도 : Gold III 제한시간: 1초메모리: 1024MB 문제 1부터 N까지의 수가 있다. 최소공배수가 최대가 되도록 서로 다른 3개의 수를 선택해 보자. 입력첫째 줄에 테스트케이스의 개수 T가 주어진다. (1≤T≤1000)둘째 줄부터 T개의 줄에 각각 자연수 N$N$이 주어진다. (3≤N≤100000) 출력각 테스트케이스마다, 최소공배수의 최댓값을 한 줄에 하나씩 차례대로 출력한다. 풀이중점은 세 수의 곱을 최대화하면서 gcd의 크기를 작게 하도록 하는 것이다.n이 홀수인 경우, lcm(n, n-1, n-2)가 가장 크다고 할 수 있다.n과 n-2가 홀수가 되어 gcd..
https://leetcode.com/problems/my-calendar-i/description/?envType=daily-question&envId=2024-09-26leetcode - My Calendar I문제 유형 : 구현, 이진 탐색문제 난이도 : Medium 문제You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a double booking.A double booking happens when two events have some non-empty intersection (i.e., some moment is common to both e..
https://codeforces.com/contest/2013/problem/ACodeforces Round 973(Div. 2) - A. Zhan's Blender문제 유형 : 구현 문제time limit per test1 secondmemory limit per test256 megabytesToday, a club fair was held at "NSPhM". In order to advertise his pastry club, Zhan decided to demonstrate the power of his blender.To demonstrate the power of his blender, Zhan has n">𝑛fruits.The blender can mix up to x">𝑥 fruit..
https://www.acmicpc.net/problem/23631BOJ - 진심 좌우 반복뛰기문제 유형 : 수학, 구현문제 난이도 : Silver I 문제히어로 협회에는 아래와 같은 두 가지 소문이 있다.진심 좌우 반복 뛰기를 10100$10^{100}$일 동안 반복하면 히어로가 된다.뛴 거리의 총합이 N$N$m 이상이면 대머리가 된다.지나가던 제로x는 소문을 듣고 진심 좌우 반복 뛰기를 하기로 결심했다. 진심 좌우 반복 뛰기는 간단하다.위치 x=0에서 시작하여, 처음에는 오른쪽으로 Km를 뛴 다음 방향을 바꾼다.방향을 바꿀 때마다 이전에 움직인 거리에 Km만큼 더한 거리를 뛰고, 다시 방향을 바꾼다.예를 들어, K=2 라면, 오른쪽으로 2m, 왼쪽으로 4m, 오른쪽으로 6m, ...하지만, 제로x는 ..