2024 UP ACM Algolympics Final Round
A. 4 ♦
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
TURN ON A
TURN ON B
WAIT A FEW MINUTES
TURN OFF B
OPEN THE DOOR
LIGHT 1 IS ON
LIGHT 2 IS HOT
Output
A B C

B. BNA
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
3 3
ABA
COUNT A 1 2
SWAP 2 3
COUNT A 1 2
13 7
ABDDACAADBEAA
COUNT A 1 13
COUNT A 1 10
SWAP 2 12
SWAP 2 3
SWAP 6 11
COUNT A 3 7
COUNT E 1 7
Output
1 2
6 4 3 1

C. Deal Breaker
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
4
ugly lame crazy weird
4
100
im lame sry
200
im ugly sry
300
im crazy and lame sry
400
im crazy and weird sry
5
no crazy or weird pls
no ugly or weird pls
no ugly or crazy pls
no weird or lame or ugly pls
no weird pls
Output
200
300
100
LOWER YOUR STANDARDS
300

D. Look, Up in the Sky!
time limit per test
6 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output
Example
Input
4 9
1 2
5 2
5 4
6 1
2
6 1
18 7
Output
1/16
1/8

E. Minimum Cost Spanning Subgraph
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
3
3 1 2
5
9 5 1 4 10
Output
1
4

F. Meta Sudoku
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
1
12..
34..
..12
..3.
4
1..3
.22.
.22.
3..4
Output
3
24

G. Pandemic
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
3 1
1 3
IHH
FFE
5 0
IHIHI
FEEEE
Output
2
0

H. Rainbow Energy
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
3 2
1 3
1 3
2 3
4 3
2 2
2 2
3 3
3 4
Output
9
16

I. Ready Player Juan
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
1
3
4 9 6
1 3 5
Output
17

J. Reservoir Doggos
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
1
123
456
3
6 24 30
14 36 60
Output
56088
4404

K. Space Colonizers
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
3
3 3
3 1 5
2 4 10
4 8 20
1 1 3 3
3 3
3 1 5
2 4 12
4 11 1
1 1 3 3
1 7
8 3 1 2 2 5 13
1 4 1 7
Output
UNOBTANIUM
UNOBTAINABLE
UNOBTANIUM

L. SwapSwap++++
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
5
3 1 4 1 5
7
SWAP 1 2
SWAP 1 3
SWAP 1 4
SWAP 1 5
SWAP 2 3
SWAP 2 5
SWAP 3 4
Output
YES
1 6 7 4 5 3 2
5 7 3 6 4 2 1

M. Yet Another Arbitrary Polynomial Problem
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output