목록2024/10/28 (3)
넘치게 채우기

https://codeforces.com/contest/2033/problem/CCodeforces Round 981(Div.3) - C. Sakurako's Field Trip문제 유형: 투 포인터, 그리디시간 제한: 2초메모리 제한: 256MB 문제Even in university, students need to relax. That is why Sakurakos teacher decided to go on a field trip. It is known that all of the students will be walking in one line. The student with index i">i has some topic of interest which is described as ai">a_i.A..
https://www.acmicpc.net/problem/9663BOJ - N-Queen문제 유형: 완전 탐색, dfs, 백트래킹, 재귀문제 난이도: Gold IV시간 제한: 10초메모리 제한: 128MB 문제N-Queen 문제는 크기가 N × N인 체스판 위에 퀸 N개를 서로 공격할 수 없게 놓는 문제이다.N이 주어졌을 때, 퀸을 놓는 방법의 수를 구하는 프로그램을 작성하시오. 입력첫째 줄에 N이 주어진다. (1 ≤ N 출력첫째 줄에 퀸 N개를 서로 공격할 수 없게 놓는 경우의 수를 출력한다. 풀이재귀 함수 solve(row)에는 이제 퀸을 넣어야 할 행의 인덱스 row를 받는다.첫 번째 방법은, 직접 N * N의 보드를 만들어서 직접 퀸이 공격하는 영역에 표시를 해두고, 공격받지 않는 열에 퀸을 두..
https://leetcode.com/problems/longest-square-streak-in-an-array/description/?envType=daily-question&envId=2024-10-28leetcode - Longest Square Streak in an Array문제 유형: 해시, 집합, 이진 탐색, 다이나믹 프로그래밍문제 난이도: Medium 문제You are given an integer array nums. A subsequence of nums is called a square streak if:The length of the subsequence is at least 2, andafter sorting the subsequence, each element (except t..