2023 UP ACM Algolympics Final Round
A. Alien Gordon Ramsey
time limit per test
1.2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
1
6
3 4
1 3
2 3
5 4
6 4
Output
4
1 4 2 3 4 1

B. Cult of Wah!
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
2
2
wah umu
3
bhv zdk xpx
1
aaa
3
bbb ccc ddd
Output
3
1

C. Dethrone Antares Now
time limit per test
1.25 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
8 9 3
1 2
2 3
3 1
3 4
4 5
5 6
6 7
7 8
8 3
1 5 7
Output
DAN
2
2 3
4 3
8 3
Input
2 1 2
1 2
1 2
Output
DAN'T
Input
8 8 2
1 2
2 3
3 1
1 4
4 6
6 5
7 5
1 8
7 8
Output
DAN
4
5 6 4 1
1 2 3 1

D. Eliens Slurs
time limit per test
11 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
14 3
1 3 2 2 1 5 1 2 1 6 1 2 2 1
1 2 1
Output
5
1 3 7 11 12
Input
5 2
1 300 300 1 299
1 300
Output
2
1 4

E. Euclidean Travel with Parallel Universes
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
1
12 1 2 8 2 3 10 3
Output
4.976414963

F. Flow Maximal
time limit per test
4 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
9
Output
14

G. Irreversible Events
time limit per test
1.25 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
3
3 2
1 2
2 3
4 3
1 2
2 3
1 3
6 7
4 2
4 1
1 2
2 3
3 1
5 6
3 6
Output
0
1
2

H. Not Just an NP-Hard Problem
time limit per test
1.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
1
3
6 7 6
Output
1 3 3
2 4
3 5
45.000000

I. Ominous Acids
time limit per test
10 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
3
Output
Ominous
9 4
OOOH
WAAH
WOAH
WOOT
HUTT
HUUY
HEYY
WEEB
WWBB

J. Sensor Logs
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
3 5
0 0
0 0
1 1
0 2
1 2
Output
010

K. Star Seeker's Socks
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
3
1 1
1
1
2 2
6 4
1 2
5 3
3 5 7 11 13
1 2 4
Output
2
3
44

L. Starquake!
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
19 7
-5 -5 4 2 4 2 4 3 4 -5 -5 -5 11 11 10 9 8 9 10
QUERY 1 19
QUERY 2 11
STARQUAKE 3 11
QUERY 2 11
FISSURE 4 9 7
QUERY 2 11
QUERY 1 19
Output
8
7
3
3
4

M. TheBuzz
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3 3
chrysler
ford
gm
A chrysler ford
B ford gm
C chrysler gm
A 1 3
C 2 3
B 2 1
Output
ford
gm
chrysler
Input
4 4
demetrius
hermia
helena
lysander
A lysander hermia
B helena demetrius
B demetrius hermia
C lysander helena
B 1 2
C 1 4
A 3 4
B 1 3
Output
IMPOSSIBLE
Input
2 1
good
evil
B good evil
B 1 2
Output
TOO MANY