본문 바로가기
공부/코딩테스트

백준: 24860번 Counting Antibodies (Python3)

by 혼밥맨 2022. 7. 31.
반응형

백준: 24860번 Counting Antibodies (Python3)

Counting Antibodies 성공다국어

 
시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB 810 588 509 75.519%

문제

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 unique type of antibody. There are plenty of potential harmful agents, so, there should be a tremendous number of immunoglobulin types to neutralize all threats. Huge required amount of immunoglobulin types make it impossible to encode each type in DNA. Luckily, there is a solution.

Immunoglobulins are produced by immune cells: B-lymphocytes based on DNA information --- genes. Immunoglobulin genes are combined from DNA fragments like constructor. Each fragment exists in several variants and is responsible for variable region of immunoglobulin molecule. This process is called somatic recombination. 

Immunoglobulin molecule consists of two identical heavy chains and two identical light chains. There are two types of light chains with similar structure --- κ and λ. Both of two light chain types have two variable regions --- V and J. To form a variable region one gene fragment is selected from multiple variants:  and  variants for V and J regions respectively in κ-light chain, or  and  variants for V and J regions respectively in λ-light chain.

There is only one heavy chain type with three variable regions --- V, D and J. To form each of them one gene fragment from Vh, Dh and Jh variants respectively is selected.

You need to count how many possible immunoglobulin molecules can be produced for given values of , , , , Vh, Dh and Jh.

입력

The first line contains two integers ,  (1≤Vκ,Jκ≤1500) --- number of gene fragment variants for κ-light chain  V and J variable regions, respectively.

The second line contains two integers ,  (1≤Vλ,Jλ≤1500) --- number of gene fragment variants for λ-light chain V and J variable regions, respectively.

The third line contains three integers Vh, Dh and Jh (1≤Vh,Dh,Jh≤1000) --- number of gene fragment variants for heavy chain V, D and J variable regions, respectively.

출력

Output one integer --- number of immunoglobulin variants that can be produced.

예제 입력 1

40 5
41 6
50 30 6

예제 출력 1

4014000

힌트

In conclusion, we note that somatic recombination is powerful protective mechanism for various bacteria and viruses, but not only one. Other ways to prevent foreign invasion are beyond the focus of this problem.

답안

1
2
3
4
v1, j1 = map(int, input().split())
v2, j2 = map(int, input().split())
v, d, j = map(int, input().split())
print( (v*j*d)*(v1*j1 + v2*j2) )
cs

반응형

댓글