목록PS (871)
넘치게 채우기
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bHHjdT/btsJGlN1LLs/Bd2V3WYKFUfyvMzN8ccLKK/img.png)
https://leetcode.com/problems/k-th-smallest-in-lexicographical-order/description/?envType=daily-question&envId=2024-09-22leetcode - K-th Smallest in Lexicographical Order문제 유형 : 트리, dfs, 수학문제 난이도 : Hard 문제Given two integers n and k, return the kth lexicographically smallest integer in the range [1, n]. 두 개의 정수 n과 k가 주어진다. 범위 [1,n]에서 사전순으로 k번째로 작은 정수를 반환하시오. 풀이순차적으로 k개를 찾는 것은 느리다.대신, 점프를 할 필요가 있다..
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://www.acmicpc.net/problem/4531BOJ - Verdis Quo문제 유형 : 문자열 처리, 구현문제 난이도 : Silver I 문제로마인들은 알파벳의 일곱 문자를 통해서 수를 표현했다. 다음은 문자와 그에 대응하는 값을 보여주는 표이다.I = 1V = 5X = 10L = 50C = 100D = 500M = 1000이 7개의 숫자와 다음 규칙들을 통해서, 로마인들은 원하는 모든 수를 적을 수 있었다.만약에 주어지는 숫자들이 감소순으로 좌에서 우로 적혀있다면, 덧셈법칙을 쓸 수 있다. 예를 들어, 로마숫자 MMCLVII는 1000 + 1000 + 100 + 50 + 5 + 1 + 1 = 2157이다.이는 로마숫자를 지나치게 길게 하는 단점이 있어 뺄셈법칙 역시 존재한다. 만약에..
https://leetcode.com/problems/shortest-palindrome/description/?envType=daily-question&envId=2024-09-20leetcode - Shortest Palindrome문제 유형 : 팰린드롬, 문자열 처리, KMP 알고리즘문제 난이도 : Hard 문제You are given a string s. You can convert s to a palindrome by adding characters in front of it.Return the shortest palindrome you can find by performing this transformation. 문자열 s를 받는다. 당신은 s에 접두사를 붙여서 변환시킬 수 있다.s에 문자를 ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/E7h92/btsJD6ceHm5/Ehw5EJHGxMvLr6TCCCRHd1/img.png)
https://www.acmicpc.net/problem/11183BOJ - Coast Length문제 유형 : BFS, DFS, 행렬, 구현문제 난이도 : Silver I 문제The island municipality of Soteholm is required to write a plan of action for their work with emission of greenhouse gases. They realize that a natural first step is to decide whether they are for or against global warming. For this purpose they have read the IPCC report on climate change and found..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/emQO0v/btsJF53ytNP/g0UwrfjRTxfFocae7cdKXk/img.png)
https://leetcode.com/problems/different-ways-to-add-parentheses/description/?envType=daily-question&envId=2024-09-19leetcode - Different Ways to Add Parentheses문제 유형 : 문자열 처리, 재귀, 다이나믹 프로그래밍, 카탈란 수문제 난이도 : Medium 문제Given a string expression of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. You may return the answe..
https://leetcode.com/problems/largest-number/description/?envType=daily-question&envId=2024-09-18leetcode - Largest Number문제 유형 : 문자열 처리, 정렬문제 난이도 : Medium 문제Given a list of non-negative integers nums, arrange them such that they form the largest number and return it.Since the result may be very large, so you need to return a string instead of an integer. 음이 아닌 정수 nums를 받는다. 이 수들을 나열하여 만들 수 있는 가..
https://leetcode.com/problems/uncommon-words-from-two-sentences/description/?envType=daily-question&envId=2024-09-17leetcode - Uncommon Words from Two Sentences문제 유형 : 문자열 처리, 해시문제 난이도 : Easy 문제A sentence is a string of single-space separated words where each word consists only of lowercase letters.A word is uncommon if it appears exactly once in one of the sentences, and does not appear in the ..
https://leetcode.com/problems/minimum-time-difference/description/?envType=daily-question&envId=2024-09-16leetcode - Minimum Time DIfference문제 유형 : 정렬, 문자열 처리문제 난이도 : Medium 문제Given a list of 24-hour clock time points in "HH:MM" format, return the minimum minutes difference between any two time-points in the list. "HH:MM"의 형식으로 24시간기준의 시간이 배열로 주어진다.두 시간의 최소 시간차를 분단위의 정수로 구하시오. 풀이우선, 모든 시간을 분단위로 ..