Codeforces Round 578 (Div. 2)


A. Hotelier
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
8
LLRL1RL1
Output
1010000011
Input
9
L0L0LLRR9
Output
1100000010
----------------------------------------------------------------------------------------------------
B. Block Adventure
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
3 0 1
4 3 5
3 1 2
1 4 7
4 10 0
10 20 10 20
2 5 5
0 11
1 9 9
99
Output
YES
NO
YES
NO
YES
----------------------------------------------------------------------------------------------------
C. Round Corridor
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 6 3
1 1 2 3
2 6 1 2
2 6 2 4
Output
YES
NO
YES
----------------------------------------------------------------------------------------------------
D. White Lines
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 2
BWWW
WBBW
WBBW
WWWB
Output
4
Input
3 1
BWB
WWB
BWB
Output
2
Input
5 3
BWBBB
BWBBB
BBBBB
BBBBB
WBBBW
Output
2
Input
2 2
BW
WB
Output
4
Input
2 1
WW
WW
Output
4
----------------------------------------------------------------------------------------------------
E. Compress Words
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
I want to order pizza
Output
Iwantorderpizza
Input
5
sample please ease in out
Output
sampleaseinout
----------------------------------------------------------------------------------------------------
F. Graph Traveler
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4
0 0 0 0
2
2 3
1
2
3
2 4 1
4
3 1 2 1
6
1 0
2 0
3 -1
4 -2
1 1
1 5
Output
1
1
2
1
3
2
Input
4
4 -5 -3 -1
2
2 3
1
2
3
2 4 1
4
3 1 2 1
6
1 0
2 0
3 -1
4 -2
1 1
1 5
Output
1
1
1
3
1
1
----------------------------------------------------------------------------------------------------
