목록PS (869)
넘치게 채우기
https://www.acmicpc.net/problem/1931BOJ - 회의실 배정문제 유형: 정렬, 그리디문제 난이도: Silver I시간 제한: 2초메모리 제한: 128MB 문제한 개의 회의실이 있는데 이를 사용하고자 하는 N개의 회의에 대하여 회의실 사용표를 만들려고 한다. 각 회의 I에 대해 시작시간과 끝나는 시간이 주어져 있고, 각 회의가 겹치지 않게 하면서 회의실을 사용할 수 있는 회의의 최대 개수를 찾아보자. 단, 회의는 한번 시작하면 중간에 중단될 수 없으며 한 회의가 끝나는 것과 동시에 다음 회의가 시작될 수 있다. 회의의 시작시간과 끝나는 시간이 같을 수도 있다. 이 경우에는 시작하자마자 끝나는 것으로 생각하면 된다. 입력첫째 줄에 회의의 수 N(1 ≤ N ≤ 100,000)이 주..
https://leetcode.com/problems/divide-intervals-into-minimum-number-of-groups/description/?envType=daily-question&envId=2024-10-12leetcode - Divide Intervals Into Minimum Numbers of Groups문제 유형: 우선순위 큐, 정렬문제 난이도: Medium 문제You are given a 2D integer array intervals where intervals[i] = [lefti, righti] represents the inclusive interval [lefti, righti].You have to divide the intervals into one or mo..
https://www.acmicpc.net/problem/1753BOJ - 최단경로문제 유형: 최단거리, 다익스트라, 우선순위 큐문제 난이도: Gold IV시간 제한: 1초메모리 제한: 256MB 문제방향그래프가 주어지면 주어진 시작점에서 다른 모든 정점으로의 최단 경로를 구하는 프로그램을 작성하시오. 단, 모든 간선의 가중치는 10 이하의 자연수이다. 입력첫째 줄에 정점의 개수 V와 간선의 개수 E가 주어진다. (1 ≤ V ≤ 20,000, 1 ≤ E ≤ 300,000) 모든 정점에는 1부터 V까지 번호가 매겨져 있다고 가정한다. 둘째 줄에는 시작 정점의 번호 K(1 ≤ K ≤ V)가 주어진다. 셋째 줄부터 E개의 줄에 걸쳐 각 간선을 나타내는 세 개의 정수 (u, v, w)가 순서대로 주어진다. 이는..
https://leetcode.com/problems/the-number-of-the-smallest-unoccupied-chair/description/?envType=daily-question&envId=2024-10-11leetcode - The Number of the Smallest Unoccupied Chair문제 유형: 정렬, 우선순위 큐문제 난이도: Medium 문제There is a party where n friends numbered from 0 to n - 1 are attending. There is an infinite number of chairs in this party that are numbered from 0 to infinity. When a friend arrives..
https://www.acmicpc.net/problem/1261BOJ - 알고스팟문제 유형: bfs, 다익스트라, 최단 경로문제 난이도: Gold IV시간 제한: 1초메모리 제한: 128MB 문제알고스팟 운영진이 모두 미로에 갇혔다. 미로는 N*M 크기이며, 총 1*1크기의 방으로 이루어져 있다. 미로는 빈 방 또는 벽으로 이루어져 있고, 빈 방은 자유롭게 다닐 수 있지만, 벽은 부수지 않으면 이동할 수 없다.알고스팟 운영진은 여러명이지만, 항상 모두 같은 방에 있어야 한다. 즉, 여러 명이 다른 방에 있을 수는 없다. 어떤 방에서 이동할 수 있는 방은 상하좌우로 인접한 빈 방이다. 즉, 현재 운영진이 (x, y)에 있을 때, 이동할 수 있는 방은 (x+1, y), (x, y+1), (x-1, y), ..
https://leetcode.com/problems/maximum-width-ramp/description/?envType=daily-question&envId=2024-10-10leetcode - Maximum Width Ramp문제 유형 : 스택, 모노토닉 스택문제 난이도 : Medium 문제A ramp in an integer array nums is a pair (i, j) for which i and nums[i] width of such a ramp is j - i.Given an integer array nums, return the maximum width of a ramp in nums. If there is no ramp in nums, return 0. 정수 배열 nums의 ra..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cDchLO/btsJZ8TvEQS/kxSdq1AV66sfeCqKyOG2XK/img.png)
https://www.acmicpc.net/problem/6907BOJ - Floor Plan문제 유형: BFS, DFS, 그래프, 정렬문제 난이도: Silver I시간 제한: 1초메모리 제한: 128MB 문제The floor plan of a house shows rooms separated by walls. This floor plan can be transferred to a grid using the character I for walls and . for room space. Doorways are not shown. Each I or . character occupies one square metre.In this diagram, there are six rooms.You have been g..
https://leetcode.com/problems/minimum-add-to-make-parentheses-valid/description/?envType=daily-question&envId=2024-10-09LeetCode - Minimum Add to Make Parentheses Valid문제 유형: 스택문제 난이도 : Medium 문제A parentheses string is valid if and only if:It is the empty string,It can be written as AB (A concatenated with B), where A and B are valid strings, orIt can be written as (A), where A is a valid string..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/NUHTx/btsJY5pwpTO/ItykXuOt7akpyj2KQBTm41/img.png)
https://www.acmicpc.net/problem/30892BOJ - 상어 키우기문제 유형: 스택, 그리디문제 난이도: Silver I시간 제한: 1.5초메모리 제한: 1024MB 문제인천대학교의 앞바다에는 N마리의 상어가 살고 있다고 한다. 각각의 상어는 서로 같거나 다른 크기의 몸집 A_i를 가지고 있다. 상어의 세계는 완전한 약육강식의 세계로, 상어 자신의 크기보다 작은 상어는 전부 먹을 수 있다. 이때, 상어의 크기는 잡아먹힌 상어의 크기만큼 커지게 된다. 반면, 자신의 크기 이상인 상어는 전혀 잡아먹지 못한다.어느 날 크기가 T인 샼이라는 이름의 아기 상어는 인천대학교 앞바다에 존재하는 N마리 상어들의 크기 정보를 모두 입수했다. 똑똑한 아기 상어 샼은 인천대학교 앞바다에 있는 상어들을 ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bGNM53/btsJYbir3b9/4sht8lkR9wWB3CpVYtk6Yk/img.png)
https://www.acmicpc.net/problem/4042BOJ - Vampires!문제 유형: 구현문제 난이도: Silver I 문제The big media gimmick these days seems to be vampires. Vampire movies, vampire television shows, vampire books, vampire dolls, vampire cereal, vampire lipstick, vampire bunnies – kids and teenagers and even some adults spend lots of time and money on vampire-related stuff. Surprisingly, nowadays vampires are often th..