#P4871. Interesting Array
Interesting Array
Interesting Array
题面翻译
构建一个序列 ,满足 条限制。
限制形如 :$a _ l\ \&\ a _ {l+1}\ \& \cdots \&\ a _ {r-1}\ \&\ a _ r = q$;(此处 为位运算的 AND 操作).
由 @Styx 提供翻译
题目描述
We'll call an array of non-negative integers a\[1\],a\[2\],...,a\[n\] interesting, if it meets constraints. The -th of the constraints consists of three integers , , ( ) meaning that value should be equal to .
Your task is to find any interesting array of elements or state that such array doesn't exist.
Expression x&y means the bitwise AND of numbers and . In programming languages C++, Java and Python this operation is represented as "&", in Pascal — as "and".
输入格式
We'll call an array of non-negative integers a\[1\],a\[2\],...,a\[n\] interesting, if it meets constraints. The -th of the constraints consists of three integers , , ( ) meaning that value should be equal to .
Your task is to find any interesting array of elements or state that such array doesn't exist.
Expression x&y means the bitwise AND of numbers and . In programming languages C++, Java and Python this operation is represented as "&", in Pascal — as "and".
输出格式
We'll call an array of non-negative integers a\[1\],a\[2\],...,a\[n\] interesting, if it meets constraints. The -th of the constraints consists of three integers , , ( ) meaning that value should be equal to .
Your task is to find any interesting array of elements or state that such array doesn't exist.
Expression x&y means the bitwise AND of numbers and . In programming languages C++, Java and Python this operation is represented as "&", in Pascal — as "and".
样例 #1
样例输入 #1
3 1
1 3 3
样例输出 #1
YES
3 3 3
样例 #2
样例输入 #2
3 2
1 3 3
1 3 2
样例输出 #2
NO