比赛 |
NOIP模拟赛1 |
评测结果 |
AAATTTTTTT |
题目名称 |
异或 |
最终得分 |
30 |
用户昵称 |
lajioj |
运行时间 |
7.010 s |
代码语言 |
C++ |
内存使用 |
1.69 MiB |
提交时间 |
2018-02-08 20:53:01 |
显示代码纯文本
- #include<bits/stdc++.h>
- using namespace std;
-
- #define NUM ch-'0'
- inline void read(int &res){
- char ch;
- bool flag=0;
- while(!isdigit(ch=getchar()))
- (flag=1)&&(ch=='-');
- for(res=NUM;isdigit(ch=getchar());res=res*10+NUM);
- (flag)&&(res=-res);
- }
- const int MAXN = 50000+2;
- int a[MAXN];
- int b[MAXN*10];
-
- void file(){
- freopen("xorxor.in","r",stdin);
- freopen("xorxor.out","w",stdout);
- }
-
- int main(){
- file();
- int n,m;
- read(n);
- read(m);
- for(int i=1;i<=n;++i){
- read(a[i]);
- }
- int p=0;
- for(int i=1;i<n;++i){
- for(int j=i+1;j<=n;++j){
- b[++p] = a[i]^a[j];
- }
- }
- sort(b+1,b+p+1);
- printf("%d",b[m]);
- }