2025 ICPC Asia Manila Regional
A. Alphabet Chocolate
time limit per test
1 second
memory limit per test
960 megabytes
input
standard input
output
standard output
Examples
Input
ICPCMANILA
Output
:)
Input
RACECAR
Output
E

B. DJ Nicholas
time limit per test
4 seconds
memory limit per test
960 megabytes
input
standard input
output
standard output
Example
Input
4 10 4
+ 7 2 6
+ 2 8 10
+ 9 1 4
? 4 9
Output
1 2 1 1

C. The Drift King
time limit per test
1 second
memory limit per test
960 megabytes
input
standard input
output
standard output
Example
Input
2
3 2
LRR
2 -1
LRR
Output
0.41421356237309504876
1.82842712474619009753

D. Drinking Culture
time limit per test
1 second
memory limit per test
960 megabytes
input
standard input
output
standard output
Example
Input
3
350 750 330
140 131 16
Output
0.19356182654786474591

E. Long Distance Examination
time limit per test
3 seconds
memory limit per test
960 megabytes
input
standard input
output
standard output
Example
Input
2
5 5
S....
.....
.....
.....
.....
....S
.....
.....
.....
....D
7 5
XXXXX
XXXXX
XS..X
X.X.X
X...X
XXXXX
XXXXX
XXXXX
XS..X
XXX.X
X...X
XXX.X
XD..X
XXXXX
Output
4
14

F. Map and Fold
time limit per test
1 second
memory limit per test
960 megabytes
input
standard input
output
standard output
Example
Input
2
3 4
.V.V.M.
M+M+M+M
.M.M.V.
V+M+V+M
.M.M.V.
2 2
.M.
M+M
.M.
Output
YES
NO

G. Max Cut Min Flow
time limit per test
1 second
memory limit per test
960 megabytes
input
standard input
output
standard output
Examples
Input
6 7
3 -1 4 1 -5
Output
15
Input
5 4
-6 -7 -6 -7
Output
-1

H. Prime Topology
time limit per test
1 second
memory limit per test
960 megabytes
input
standard input
output
standard output
Example
Input
3
5 2
6 3
10000000 10000000
Output
5
2
0

I. Stone Steps
time limit per test
1 second
memory limit per test
960 megabytes
input
standard input
output
standard output
Examples
Input
3141
Output
1432
Input
1
Output
1
Input
11234567891234567891
Output
43138332

J. Tic-Tac-Toe on a Graph
time limit per test
1 second
memory limit per test
960 megabytes
input
standard input
output
standard output
Example
Input
8 9
1 2
1 4
1 5
2 3
2 7
3 4
3 5
3 6
4 6
Output
5

K. Toxic Culinarity
time limit per test
4 seconds
memory limit per test
960 megabytes
input
standard input
output
standard output
Example
Input
3 2 4
1 2
2 3
1 3
1 2
Output
612368387
1071644675
153092098
1071644675

L. Trace of Product of Sparse Square Matrices
time limit per test
1.5 seconds
memory limit per test
960 megabytes
input
standard input
output
standard output
Example
Input
3
4
2 1 6
2 3 6
3 1 4
3 2 3
4
1 1 2
1 3 3
2 3 3
3 2 1
Output
27

M. Web Delivery
time limit per test
1 second
memory limit per test
960 megabytes
input
standard input
output
standard output
Example
Input
2
3 5
1 3 5 7 9
5 7 9 1 3
9 1 3 5 7
4 3 2 3 4
4 3
1 2 4
2 3 1
4 1 2
3 2 1
2 4 4
Output
11
11