PCCA Winter Camp Contest 2023
A. ATCG
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
3
4
ATCG
4
ACGT
6
ATGGCT
Output
CGAT
ACGT
AGCCAT

B. Buying Mascots
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Examples
Input
5 10
5 6 0 10 2
2 3 10 0 3
Output
13
Input
7 100
21 15 0 32 21 23 14
8 23 20 67 31 72 15
Output
87

C. Colorful Pictures
time limit per test
15 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Examples
Input
4
2 1
2 3
2 4
Output
16
Input
2
1 2
Output
2
Input
23
3 13
9 14
8 20
11 4
8 22
6 10
6 2
18 8
19 8
8 9
4 8
4 5
3 8
23 8
15 12
1 14
16 8
2 12
7 6
8 21
8 6
17 8
Output
616298673

D. Duo of Magicians
time limit per test
1.5 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output
Example
Input
3
5
1 3 5 2 4
6
6 5 4 3 2 1
3
1 2 3
Output
3
2 3
2 4
4 5
5
3 4
2 5
1 2
1 6
1 2
0

E. Exterior
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Examples
Input
4 4
6 2 1 5
1 2 1
2 3 6
1 3 8
3 4 2
Output
6
Input
5 4
12 23 34 45 56
1 2 1
2 3 1
3 4 1
4 5 1
Output
4
Input
6 7
8 5 1 7 8 6
2 3 1
2 5 1
3 5 4
2 6 3
4 5 17
3 4 10
5 6 2
Output
13

F. Formidable Team
time limit per test
1.5 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
6 5
5 5 4 3 4
4 2 3 3 3
4 5 2 5 1
3 3 1 3 1
4 4 2 3 1
2 2 1 3 1
Output
19
1 5
2 3
3 4
4 1
5 2

G. Genetic Sequence Searching
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Examples
Input
PCCA_Winter_Camp_2023
AC
Output
4
1 2 4 12
Input
meowmeow
owo
Output
1
3

H. Heritage in the PCCA Kingdom
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Examples
Input
4
   /\
   --
  /..\
  ----
 /\/./\
 --..--
/\/..\.\
--------
Output
4
Input
4
   /\
   ..
  /..\
  ....
 /....\
 ......
/......\
--------
Output
6
Input
6
     /\
     ..
    /./\
    ..--
   /....\
   --....
  /./.../\
  ----..--
 /\/\..../\
 --....--..
/..././\../\
------------
Output
14

I. Interval Cover
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
5 10
0 3
3 4
4 10
0 7
7 10
7
3
1 1 6
3
1 0 1
3
2 4 10
3
Output
0
2
1
2

J. Jewelry Box
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
2 2
#.
.#
3 4
#..#
..#.
#..#
Output
#C
.#
#FF#
BF#.
#..#

K. K-restricted Induced Subgraphs
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Examples
Input
5 4 3
1 2 3 4 5
1 2
2 3
3 4
4 5
Output
4
Input
7 8 2
3 4 6 5 6 5 7
1 3
1 6
2 6
2 3
6 7
2 7
2 4
2 5
Output
5
Input
4 4 1
100 100 100 100
1 2
2 3
3 4
4 1
Output
4

L. Linear Classifers
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Examples
Input
8
0 0
7 2
4 0
5 7
3 9
8 10
1 6
7 10
Output
5 52 -1 3 5 156
1 1 2 20 1 70
Input
4
0 0
1 0
1 1
2 1
Output
1 0 1 1 2 1
1 -1 1 1 2 -1

M. Mini Factorization Challenge
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Examples
Input
1
100000 10
Output
102000 80
Input
2
931072 98
223830 47
Output
131072 18
223839 48

N. Nancy's Numbers
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Examples
Input
7
3 1 4 1 5 9 2
Output
5
Input
1
77777
Output
0
Input
5
100 100 100 100 100
Output
10