목록2025/01/23 (3)
넘치게 채우기
https://codeforces.com/contest/2063/problem/ACodeforces Round 1000(Div.2) - A. Minimal Coprime문제 유형: 수학, 그리디시간 제한: 1초메모리 제한: 256MB 문제A segment of positive integers [l,r]">[l,r] is called coprime if l">l and r">r are coprime.A coprime segment [l,r]">[l,r] is called minimal coprime if it does not contain any coprime segment not equal to itself. To better understand this statement, you can refer to..
https://www.acmicpc.net/problem/28707BOJ - 배열 정렬문제 유형: 문자열 처리, 최단 경로, 다익스트라, 해시문제 난이도: Gold I시간 제한: 1초메모리 제한: 1024MB 문제길이가 N인 양의 정수로 이루어진 배열 A=[A1,A2,⋯,AN]이 주어집니다. 이 배열을 비내림차순, 즉, A1≤A2≤⋯≤AN이 되도록 정렬하기 위해서 다음과 같은 M가지 조작을 순서와 횟수에 상관 없이 원하는 만큼 할 수 있습니다. A의 li번째 수와 ri번째 수를 바꿉니다. 비용은 ci가 듭니다. (1≤i≤M) A를 비내림차순으로 정렬하기 위해 필요한 비용 총합의 최솟값을 출력하세요. 입력첫 줄에 배열 A의 길이 N이 주어집니다. (2≤N≤8)둘째 줄에 A의 각 원소 A1,⋯,AN이 공백으..
https://leetcode.com/problems/count-servers-that-communicate/description/leetcode - Count Servers that Communicate문제 유형: 행렬문제 난이도: Medium 문제You are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell there is a server and 0 means that it is no server. Two servers are said to communicate if they are on the same row or on the same column.Retu..