목록전체 글 (35)
승형님의 블로그

https://www.acmicpc.net/problem/15948 15948번: 간단한 문제 자연수 $n$, $m$과 자연수 수열 $A_1, A_2, \cdots, A_m$이 주어졌을 때, 다음 등식을 만족하는 자연수 수열 $B_1, B_2, \cdots, B_m$을 구하라. \[1 + \frac{2^m - 1}{n} = \frac{(A_1 + B_1)(A_2 + B_2)\cdots(A_m + B_m)}{B_1B_2\cdots www.acmicpc.net 요약 수 N과 M, 길이가 M인 수열 A가 주어졌을 때, 주어진 수식을 만족하는 수열 B를 구하라. N의 기우성에 따라 다른 처리를 통해 M을 1씩 줄여나갈 수 있다. #include using namespace std; using ll = long ..
https://www.acmicpc.net/problem/26969 26969번: Bribing Friends Line $1$ contains three numbers $N$, $A$, and $B$, representing the number of friends, the amount of mooney, and the number of ice cream cones Bessie has respectively. Each of the next $N$ lines contains three numbers, $P_i$, $C_i$, and $X_i$, representing www.acmicpc.net 요약 A원과 B개의 아이스크림 콘을 갖고 있다. N명의 친구는 각각 $P_i$의 인기도, $C_i$의 비용, $X..
https://www.acmicpc.net/problem/26966 26966번: Breakdown Farmer John's farm can be represented as a directed weighted graph, with roads (edges) connecting different nodes, and the weight of each edge being the time required to travel along the road. Every day, Bessie likes to travel from the barn (located at nod www.acmicpc.net 요약 가중치가 있는 방향그래프가 주어진다. 정점의 개수 N과 K가 주어질 때, 간선을 순서대로 삭제하여 정확히 K번 간선을 ..
https://www.acmicpc.net/problem/26971 26971번: Strongest Friendship Group The maximum strength can be observed to be with the group of cows numbered $1, 2, 3, 4$. The minimum number of friends of any cow in this group within the group is $3$, so the answer is $4\cdot 3=12$. www.acmicpc.net 요약 그래프에서 (sub graph의 크기) * (sub graph 내부의 정점의 최소 degree) 의 최대를 구하여라. 1. 정점의 개수 N과 간선의 개수 M이 주어진다. 이때, 주어진 그래..
https://atcoder.jp/contests/abc303 NS Solutions Corporation Programming Contest 2023(AtCoder Beginner Contest 303) - AtCoder AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp A. Similar String 요약 주어지는 문자열에서 1은 'l'로, 0은 'o'로 대체되어 similar string이 될 수 있다고 한다. 두 문자열이 주어졌을 때, similar string인지 판단한다. 모든 1과 'l', 0, 'o'에 대하여..
https://atcoder.jp/contests/abc281 AtCoder Beginner Contest 281 - AtCoder AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp A. Count Down 요약 N보다 작거나 같은 음수가 아닌 정수를 내림차순으로 출력한다. #include using namespace std; int N; int main(void) { ios::sync_with_stdio(false); cin.tie(0); cin >> N; for (int i = N; i >= 0; i--) cout S;..