Contest2037 - CSU Monthly 2013 Oct (problem F :ZZY and his little friends)

http://acm.csu.edu.cn/OnlineJudge/problem.php?cid=2037&pid=5

【题解】:

没想通这题暴力可以过。。。。

【code】:

 1 #include<iostream>
 2 #include<stdio.h>
 3 #include<string.h>
 4 using namespace std;
 5 
 6 int arr[100010];
 7 
 8 int main()
 9 {
10     int n,m;
11     while(~scanf("%d%d",&n,&m))
12     {
13         int i,j;
14         for(i=0;i<n;i++)    scanf("%d",arr+i);
15         for(i=0;i<n;i++)
16         {
17             for(j=i+1;j<n;j++)
18             {
19                 if((arr[i]^arr[j])>m)
20                     break;
21             }
22             if(j<n) break;
23         }
24         if(i<n)
25         {
26             puts("YES");
27         }
28         else
29         {
30             puts("NO");
31         }
32     }
33     return 0;
34 }

 

posted @ 2013-10-02 17:14  crazy_apple  阅读(213)  评论(0编辑  收藏  举报