Codeforces Round 794 (Div. 2)


A. Everything Everywhere All But One
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3
42 42 42
5
1 2 3 4 5
4
4 3 2 1
3
24 2 22
Output
YES
YES
NO
NO
----------------------------------------------------------------------------------------------------
B. Odd Subarrays
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
3
1 2 3
4
4 3 2 1
2
1 2
2
2 1
6
4 5 6 1 2 3
Output
0
2
0
1
1
----------------------------------------------------------------------------------------------------
C. Circular Local MiniMax
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3
1 1 2
4
1 9 8 4
4
2 0 2 2
6
1 1 1 11 111 1111
Output
NO
YES
1 8 4 9 
NO
YES
1 11 1 111 1 1111 
----------------------------------------------------------------------------------------------------
D. Linguistics
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
8
1 0 0 0
B
0 0 1 0
AB
1 1 0 1
ABAB
1 0 1 1
ABAAB
1 1 2 2
BAABBABBAA
1 1 2 3
ABABABBAABAB
2 3 5 4
AABAABBABAAABABBABBBABB
1 3 3 10
BBABABABABBBABABABABABABAABABA
Output
NO
YES
YES
YES
YES
YES
NO
YES
----------------------------------------------------------------------------------------------------
E. Bring Balance
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
2
(())
5
())((()))(
6
())((()))(()
Output
0
2
3 4
9 10
1
2 11
----------------------------------------------------------------------------------------------------
F. Permutation Weight (Easy Version)
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

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