목록구현 (52)
넘치게 채우기
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://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는 ..
https://leetcode.com/problems/sum-of-prefix-scores-of-strings/description/?envType=daily-question&envId=2024-09-25leetcode - Sum of Prefix Scores of Strings문제 유형 : 트라이(Trie), 구현문제 난이도 : Hard 문제You are given an array words of size n consisting of non-empty strings.We define the score of a string word as the number of strings words[i] such that word is a prefix of words[i].For example, if words = ..
https://www.acmicpc.net/problem/21558BOJ - 전쟁 준비하기문제 유형 : 구현, 수학, 그리디문제 난이도 : Silver I 문제이번에 폴리매스 왕국은 이웃 나라인 사이언스보드를 정복하기 위해 전쟁을 치르려고 합니다. 당신은 전쟁에서 사용할 방진을 짜 달라는 부탁을 받아 방진을 연구하고 있습니다.전쟁 지역의 지형상 가장 효율적인 방진은 직사각형 구조일 것으로 보입니다.즉 X행Y열의 직사각형을 정확히 XY명의 병사가 채우고 있는 형태를 말합니다. 병사의 수가 정확히 떨어지지 않아 몇 명이 남거나 부족한 경우에는 이러한 방진을 짤 수 없습니다.폴리매스 문명은 예전에도 강력한 군사력으로 주변의 약소국을 다수 복속시켰으므로, 군대에도 서로 다른N개의 민족이 섞여 있습니다. 특히, ..
https://leetcode.com/problems/lexicographical-numbers/description/?envType=daily-question&envId=2024-09-21leetcode - Lexicographical Numbers문제 유형 : 수학, 구현, dfs, 재귀문제 난이도 : Medium 문제Given an integer n, return all the numbers in the range [1, n] sorted in lexicographical order.You must write an algorithm that runs in O(n) time and uses O(1) extra space. 정수 n이 주어진다. [1, n]의 모든 숫자들을 사전순으로 정렬하여 반환하시..
https://leetcode.com/problems/find-missing-observations/description/?envType=daily-question&envId=2024-09-05leetcode - Find Missing Observations문제 유형 : 구현, 수학문제 난이도 : Medium 문제You have observations of n + m 6-sided dice rolls with each face numbered from 1 to 6. n of the observations went missing, and you only have the observations of m rolls. Fortunately, you have also calculated the average va..
https://leetcode.com/problems/walking-robot-simulation/leetcode - Walking Robot Simulation문제 유형 : 구현, 해시, 이진탐색문제 난이도 : Medium 문제A robot on an infinite XY-plane starts at point (0, 0) facing north. The robot can receive a sequence of these three possible types of commands:-2: Turn left 90 degrees.-1: Turn right 90 degrees.1 k units, one unit at a time.Some of the grid squares are obstacles. The ..
https://leetcode.com/problems/sum-of-digits-of-string-after-convert/description/?envType=daily-question&envId=2024-09-03leetcode - Sum of Digits of String After Convert문제 유형 : 문자열 처리, 구현문제 난이도 : Easy 문제You are given a string s consisting of lowercase English letters, and an integer k.First, convert s into an integer by replacing each letter with its position in the alphabet (i.e., replace 'a' wi..