没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
The 2021 ICPC Asia Kunming Regional Programming Contest
Online, April 17, 2022
Problem A. Amino Acids
Input file: standard input
Output file: standard output
Time limit: 1 second
Memory limit: 256 megabytes
There are 20 kinds of common amino acids in the natural world. In this problem, we only consider 10 of
them: Alanine, Asparagine, Aspartate, Cysteine, Glutamine, Glutamate, Glycine, Methionine, Serine and
Threonine.
By condensation reaction, n (n ≥ 2) amino acids can be linked by n−1 peptide bonds into a peptide chain
and produce n − 1 water molecules at the same time. Recall that each water molecule has a molecular
mass of 18.
Idealized scheme showing condensation of two amino acids to give a peptide bond.
Given a set of different amino acids and a number N, you are asked to print the structural formula of
all possible peptide chains, with a molecular mass not greater than N, which can be formed by the given
amino acids. Chains are considered different if the permutations of amino acids of the chain is different.
Here are the structural formula of the 10 amino acids and the peptide bond.
Ala: Asp: Asn: Cys: Gly:
H H O H H O H H O H H O H H O
| | || | | || | | || | | || | | ||
H-N-C-C-O-H H-N-C-C-O-H H-N-C-C-O-H H-N-C-C-O-H H-N-C-C-O-H
| | | | |
H-C-H H-C-H H-C-H H-C-S-H H
| | | |
H O=C-O-H O=C-N-H H
|
H
Ser: Met: Thr: Gln: Glu: Peptide bond:
H H O H H O H H O H H O H H O O H
| | || | | || | | || | | || | | || || |
H-N-C-C-O-H H-N-C-C-O-H H-N-C-C-O-H H-N-C-C-O-H H-N-C-C-O-H -C---N-
| | | | |
H-C-O-H H-C-H H-C-O-H H-C-H H-C-H
| | | | |
H H-C-H H-C-H H-C-H H-C-H
| | | |
S H O=C-N-H O=C-O-H
| |
H-C-H H
|
H
Page 1 of 16
The 2021 ICPC Asia Kunming Regional Programming Contest
Online, April 17, 2022
See below for molecular mass of amino acids.
Amino acid 3-letter symbol Molecular mass
Alanine Ala 89
Asparagine Asn 132
Aspartate Asp 133
Cysteine Cys 121
Glutamine Gln 146
Glutamate Glu 147
Glycine Gly 75
Methionine Met 149
Serine Ser 105
Threonine Thr 119
Input
The first line contains two integers M and N (1 ≤ M ≤ 10, 1 ≤ N ≤ 450), denoting the number of amino
acids and the molecular mass upper bound.
The second line contains M strings, each consisting of 3 letters denoting a kind of amino acid.
Output
In the first line, print a single integer denoting the number of possible peptide chains.
Then print the structural formula of every possible peptide chain by the lexicographical order of their
3-letter sequences, separated by a blank line in between.
Example
standard input standard output
2 150
Ala Gly
3
H H O H H O
| | || | | ||
H-N-C-C---N-C-C-O-H
| |
H-C-H H
|
H
H H O H H O
| | || | | ||
H-N-C-C---N-C-C-O-H
| |
H H-C-H
|
H
H H O H H O
| | || | | ||
H-N-C-C---N-C-C-O-H
| |
H H
Page 2 of 16
The 2021 ICPC Asia Kunming Regional Programming Contest
Online, April 17, 2022
Problem B. Blocks
Input file: standard input
Output file: standard output
Time limit: 1 second
Memory limit: 256 megabytes
Painting is always a boring job.
There are n blocks on an infinite two-dimensional plane. Each block is a rectangle parallel to the x-axis
and y-axis with a non-zero area.
The coordinates of bottom-left corner and top-right corner of the i-th block are (x
1,i
, y
1,i
) and (x
2,i
, y
2,i
).
There is another block with coordinates of bottom-left corner and top-right corner are (0, 0) and (W, H).
Nike wants to paint this block black. He will repeatedly choose one of the n blocks uniformly at random
and fill it black, until the rectangle ((0, 0), (W, H)) is completely filled black.
Find the expected value of the number of times the procedure is done, modulo 998244353. If Nike will
never fill ((0, 0), (W, H)) completely black, output −1.
Input
The input contains several test cases, and the first line contains a positive integer T indicating the number
of test cases which is up to 500.
For each test case, the first line contains an integer n (1 ≤ n ≤ 10).
The second line contains 2 integers W, H (1 ≤ W, H ≤ 10
9
).
Each of the following n lines contains 4 integers x
1,i
, y
1,i
, x
2,i
, y
2,i
(0 ≤ x
1,i
< x
2,i
≤ 10
9
,
0 ≤ y
1,i
< y
2,i
≤ 10
9
), describing the coordinates according to the problem statement.
Output
For each test case, output one line, the answer modulo 998244353. If the procedure is impossible to stop,
output −1.
It can be proved that the expected value is always a rational number. Additionally, under the constraints of
this problem, when that value is represented as Q/P using two coprime integers P and Q, it can be proved
that there uniquely exists an integer R such that R × Q ≡ P (mod 998244353) and 0 ≤ R < 998244353.
In this case, you should find this R.
Example
standard input standard output
1
8
5 5
0 0 2 2
2 2 5 5
0 2 2 5
2 0 5 2
0 0 1 1
1 1 5 5
0 1 1 5
1 0 5 1
10
Page 3 of 16
剩余15页未读,继续阅读
自行自路,别后无书
- 粉丝: 7
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0