목록PS (871)
넘치게 채우기
![](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..
https://leetcode.com/problems/minimum-number-of-swaps-to-make-the-string-balanced/description/?envType=daily-question&envId=2024-10-08leetcode - Minimum Number of Swaps to Make the String Balanced문제 유형: 스택문제 난이도 : Medium 문제You are given a 0-indexed string s of even length n. The string consists of exactly n / 2 opening brackets '[' and n / 2 closing brackets ']'.A string is called balanced if an..
https://leetcode.com/problems/minimum-string-length-after-removing-substrings/description/?envType=daily-question&envId=2024-10-07leetcode - Minimum String Length After Removing Substrings문제 유형 : 스택문제 난이도 : Easy 문제You are given a string s consisting only of uppercase English letters.You can apply some operations to this string where, in one operation, you can remove any occurrence of one of the ..
https://www.acmicpc.net/problem/2403BOJ - 게시판 구멍 가리기문제 유형: 기하학, 수학, 이진 탐색문제 난이도: Gold III시간 제한: 2초메모리 제한: 128MB 문제교실 게시판에 압정을 사용하여 만들어진 구멍들을 안보이게 하기 위해서 두 개의 같은 크기의 정사각형 모양의 종이로 가리려고 한다. 두 종이는 서로 떨어져도 되고 서로 겹치는 부분이 있어도 상관없지만 모든 구멍들을 포함해야 한다. 단, 각 구멍은 크기가 매우 작아, x, y 좌표로 표현되는 점으로 표현되고, 구멍이 종이의 경계나 모서리에 놓이는 것도 종이에 포함되는 것으로 한다. 게시판에 각 구멍의 위치가 주어지고, 두 종이가 모두 게시판의 틀에 대해서 수평과 수직으로 놓인다고 할 때, 모든 구멍을..
https://leetcode.com/problems/sentence-similarity-iii/description/?envType=daily-question&envId=2024-10-06leetcode - Sentence Similarity III문제 유형 : 문자열 처리, 투 포인터문제 난이도 : Medium 문제You are given two strings sentence1 and sentence2, each representing a sentence composed of words. A sentence is a list of words that are separated by a single space with no leading or trailing spaces. Each word consist..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/RJ0hg/btsJWPziQHW/Zd3g7y9cGMQXjZCGhXMuQ0/img.png)
https://www.acmicpc.net/problem/6514BOJ - Expressions문제 유형: 스택, 큐, 트리문제 난이도: Silver I시간 제한: 1초메모리 제한: 128MB 문제Arithmetic expressions are usually written with the operators in between the two operands (which is called infix notation). For example, (x+y)*(z-w) is an arithmetic expression in infix notation. However, it is easier to write a program to evaluate an expression if the expression is writ..
https://leetcode.com/problems/permutation-in-string/description/?envType=daily-question&envId=2024-10-05leetcode - Permutation in String문제 유형 : 슬라이딩 윈도우, 해시문제 난이도 : Medium 문제Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise.In other words, return true if one of s1's permutations is the substring of s2. 두 문자열 s1과 s2가 주어진다.만약 s2가 s1의 순열을 포함한다면 true를, 아..
https://leetcode.com/problems/divide-players-into-teams-of-equal-skill/description/?envType=daily-question&envId=2024-10-04leetcode - Divide Players Into Teams of Equal Skill문제 유형 : 정렬, 그리디, 투 포인터문제 난이도 : Medium 문제You are given a positive integer array skill of even length n where skill[i] denotes the skill of the ith player. Divide the players into n / 2 teams of size 2 such that the total skil..
https://www.acmicpc.net/problem/25601BOJ - 자바의 형변환문제 유형 : 해시, 그래프, 트리문제 난이도 : Silver I시간 제한: 2초메모리 제한: 512MB 문제자바의 클래스끼리는 상속을 통해 자신의 기능 일부를 다른 클래스에게 이식할 수 있다. 여기서 상속을 받은 클래스는 자식 클래스, 상속을 한 클래스는 부모 클래스가 된다. 클래스를 이용해서 만든 객체는 다른 클래스로 형태를 변환할 수 있는데, 이를 형변환(Casting)이라고 한다. 만약 자식 클래스에서 부모 클래스로 변환한다면 업캐스팅(Upcasting), 부모 클래스에서 자식 클래스로 변환한다면 다운캐스팅(Downcasting) 이라고 부른다. 즉, 자식 클래스와 부모 클래스 관계에 놓여있다면 형변환이 가능..