※ 글쓴이는 취미로 코딩을 익혀보는 사람이라 정확하지 않은 내용을 담고 있을 수 있다 ※
이번에 볼 문제는 백준 24860번 문제인 Counting Antibodies이다.
문제는 아래 링크를 확인하자.
https://www.acmicpc.net/problem/24860
24860번: Counting Antibodies
Immunoglobulins also known as antibodies are protein molecules. Antibodies play one of the key roles in the immune reaction --- they detect harmful foreign agents --- bacteria or viruses --- and help to eliminate them. Every foreign molecule binds with uni
www.acmicpc.net
문제에 따르면 하나의 Antibody는 두 개의 동일한 heavy chain과 두 개의 동일한 light chain으로 구성된다.
light chain에는 κ type과 λ type이 있고, 각 type은 각각 (Vκ * Jκ)가지와 (Vλ * Jλ)가지가 존재한다는 것을 알 수 있다.
따라서 light chain은 (Vκ * Jκ + Vλ * Jλ)가지 존재한다.
비슷한 방식으로 heavy chain은 (Vh * Dh * Jh)가지 존재한다.
위의 두 값을 곱해 답을 구하고 출력하여 문제를 해결하자.
아래는 제출한 소스코드이다.
#include <iostream>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
ll Vk, Jk, Vl, Jl, Vh, Dh, Jh; cin >> Vk >> Jk >> Vl >> Jl >> Vh >> Dh >> Jh;
cout << (Vk * Jk + Vl * Jl) * Vh * Dh * Jh;
}
'BOJ' 카테고리의 다른 글
[BOJ 24430 // C++] 알고리즘 수업 - 행렬 경로 문제 7 (0) | 2022.04.10 |
---|---|
[BOJ 24427 // C++] 알고리즘 수업 - 행렬 경로 문제 4 (0) | 2022.04.10 |
[BOJ 24419 // C++] 알고리즘 수업 - 행렬 경로 문제 2 (0) | 2022.04.10 |
[BOJ 24993 // C++] KIARA is a Recursive Acronym (0) | 2022.04.10 |
[BOJ 24428 // C++] 알고리즘 수업 - 행렬 경로 문제 5 (0) | 2022.04.10 |