Helvetic Coding Contest 2018 online mirror (teams allowed, unrated)


A1. Death Stars (easy)
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
XOOO
XXOO
OOOO
XXXX
XOOO
XOOO
XOXO
XOXX
Output
Yes
Input
2
XX
OO
XO
OX
Output
No
----------------------------------------------------------------------------------------------------
A2. Death Stars (medium)
time limit per test: 2.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 5
somer
andom
noise
mayth
eforc
ebewi
thyou
hctwo
again
noise
somermayth
andomeforc
noiseebewi
againthyou
noisehctwo
Output
4 6
----------------------------------------------------------------------------------------------------
A3. Death Stars (hard)
time limit per test: 7 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

No test samples are available for this problem
----------------------------------------------------------------------------------------------------
B1. Maximum Control (easy)
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
4 1
4 2
1 3
1 5
Output
3
Input
4
1 2
4 3
1 4
Output
2
----------------------------------------------------------------------------------------------------
B2. Maximum Control (medium)
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2
2 3
Output
1 3 3 
Input
4
1 2
3 2
4 2
Output
1 3 4 4 
----------------------------------------------------------------------------------------------------
C1. Encryption (easy)
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 10
3 4 7 2
Output
16
Input
10 12
16 3 24 13 9 8 7 5 12 12
Output
13
----------------------------------------------------------------------------------------------------
C2. Encryption (medium)
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4 3 10
3 4 7 2
Output
16
Input
10 5 12
16 3 24 13 9 8 7 5 12 12
Output
37
----------------------------------------------------------------------------------------------------
C3. Encryption (hard)
time limit per test: 2.2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4 3 10
3 4 7 2
Output
6
Input
10 5 12
16 3 24 13 9 8 7 5 12 12
Output
13
----------------------------------------------------------------------------------------------------
D1. Hyperspace Jump (easy)
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
(99+98)/97
(26+4)/10
(12+33)/15
(5+1)/7
Output
1 2 2 1 
----------------------------------------------------------------------------------------------------
D2. Hyperspace Jump (hard)
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
8 2
1
5 0
1
0 1
1
0 1
2
0 6
0 1
2
0 1
1 0
2
-5 -5
4 3
2
1 1
0 1
2
1 0
1 0
Output
1 2 2 2 3 3 3 1 
----------------------------------------------------------------------------------------------------
E1. Guard Duty (easy)
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3
0 0
2 0
3 1
-2 1
0 3
2 2
Output
Yes
Input
2 1
1 0
2 2
3 1
Output
No
----------------------------------------------------------------------------------------------------
E2. Guard Duty (medium)
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 5
1 4 6 7 12
Output
4
Input
3 6
6 3 4 2 5 1
Output
3
Input
4 12
15 7 4 19 3 30 14 1 5 23 17 25
Output
6
----------------------------------------------------------------------------------------------------
E3. Guard Duty (hard)
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
6 6
5 1
2 4
4 0
5 4
1 2
2 1
3 5
Output
4
1
2
3
----------------------------------------------------------------------------------------------------
F1. Lightsabers (easy)
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 2
1 1 2 2 1
1 2
Output
YES
----------------------------------------------------------------------------------------------------
F2. Lightsabers (medium)
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
8 3
3 3 1 2 2 1 1 3
3 1 1
Output
1
----------------------------------------------------------------------------------------------------
F3. Lightsabers (hard)
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 3 2
1 2 3 2
Output
4
----------------------------------------------------------------------------------------------------
