CF241D.Numbers
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You have a sequence of n distinct integers a1,a2,...,an (1<=ai<=n) . You want to remove some integers in such a way that the resulting sequence of integers satisfies the following three conditions:
- the resulting sequence is not empty;
- the exclusive or ( xor operation) of all the integers in the resulting sequence equals 0 ;
- if you write all the integers of the resulting sequence (from beginning to the end) in a row in the decimal numeral system and without any spaces, the written number is divisible by p .
You are given the sequence of n integers a and a prime number p , find a way to satisfy the described conditions.
输入格式
The first line of the input contains two integers n and p (1<=n,p<=50000) . Next line contains n space-separated distinct integers a1,a2,...,an (1<=ai<=n) .
It is guaranteed that p is a prime number.
输出格式
If there is no solution for the given input, print "No" (without quotes) in the only line of the output.
Otherwise print "Yes" in the first line of output. The second line should contain an integer k (k>0) specifying the number of remaining elements and the third line should contain k distinct integers x1,x2,...,xk (1<=xi<=n) . These integers mean that you should remove all integers from the sequence except integers ax1,ax2,...,axk to satisfy the described conditions.
If there are multiple solutions, any of them will be accepted.
输入输出样例
输入#1
3 3 1 2 3
输出#1
Yes 3 1 2 3
输入#2
3 5 1 2 3
输出#2
No