Codeforces 742B B. Arpa’s obvious problem and Mehrdad’s terrible solution
来源:互联网 发布:安知玉如意百度云 编辑:程序博客网 时间:2024/06/11 09:45
利用 x = a^b b = x^a 由b找到a 一个循环搞定!
#include <iostream> #include <cstdio>#include <cstdlib>#include <cmath>#include <algorithm>#include <climits>#include <cstring>#include <string>#include <set>#include <map>#include <queue>#include <stack>#include <vector>#include <list>#define rep(i,m,n) for(i=m;i<=n;i++)#define rsp(it,s) for(set<int>::iterator it=s.begin();it!=s.end();it++)const int inf_int = 2e9;const long long inf_ll = 2e18;#define inf_add 0x3f3f3f3f#define mod 1000000007#define vi vector<int>#define pb push_back#define mp make_pair#define fi first#define se second#define pi acos(-1.0)#define pii pair<int,int>#define Lson L, mid, rt<<1#define Rson mid+1, R, rt<<1|1const int maxn=5e2+10;using namespace std;typedef long long ll;typedef unsigned long long ull; inline int read(){int ra,fh;char rx;rx=getchar(),ra=0,fh=1;while((rx<'0'||rx>'9')&&rx!='-')rx=getchar();if(rx=='-')fh=-1,rx=getchar();while(rx>='0'&&rx<='9')ra*=10,ra+=rx-48,rx=getchar();return ra*fh;}//#pragma comment(linker, "/STACK:102400000,102400000")ll gcd(ll p,ll q){return q==0?p:gcd(q,p%q);}ll qpow(ll p,ll q){ll f=1;while(q){if(q&1)f=f*p;p=p*p;q>>=1;}return f;}ll n,x,t1; ll a[1000005];int main(){ios::sync_with_stdio(false); ll ct = 0;cin >> n >> x;for(int i=1;i<=n;i++){cin >> t1;ll t = t1^x;ct += a[t];a[t1]++;}cout << ct <<endl;return 0; }
0 0
- Codeforces 742B B. Arpa’s obvious problem and Mehrdad’s terrible solution
- B. Arpa’s obvious problem and Mehrdad’s terrible solution
- 【codeforces 742B】Arpa’s obvious problem and Mehrdad’s terrible solution
- Codeforces 742B Arpa’s obvious problem and Mehrdad’s terrible solution(map水题)
- Codeforces 742B Arpa’s obvious problem and Mehrdad’s terrible solution
- CodeForces 742B Arpa’s obvious problem and Mehrdad’s terrible solution
- codeforces 742B - Arpa’s obvious problem and Mehrdad’s terrible solution
- CodeForces - 742B Arpa’s obvious problem and Mehrdad’s terrible solution
- Codeforces 742B-Arpa’s obvious problem and Mehrdad’s terrible solution
- 742 B - Arpa’s obvious problem and Mehrdad’s terrible solution codeforces
- Codeforces Round #383 (Div. 2) 742B Arpa’s obvious problem and Mehrdad’s terrible solution
- Codeforces 742 B. Arpa’s obvious problem and Mehrdad’s terrible solution
- Codeforces 742B Arpa’s obvious problem and Mehrdad’s terrible solution
- codeforces 742B Arpa’s obvious problem and Mehrdad’s terrible solution
- CodeForces 742B Arpa’s obvious problem and Mehrdad’s terrible solution
- Codeforces Round #383 (Div. 2) B. Arpa’s obvious problem and Mehrdad’s terrible solution
- Codeforces Round #383 (Div. 2) B. Arpa’s obvious problem and Mehrdad’s terrible solution
- Codeforces Round #383 (Div. 2) B. Arpa’s obvious problem and Mehrdad’s terrible solution
- 常见的Python面试题+详细解答
- Python爬虫爬取Html中的Url常用知识
- spring mvc <mvc:annotation-driven/> 和<context:component-scan base-package=""/>解释
- Redis数据类型-List
- 修复miniblink无法显示某个网站的某个图标的bug
- Codeforces 742B B. Arpa’s obvious problem and Mehrdad’s terrible solution
- android入门小知识
- Tablayout使用小结
- 第十二章-无线传感网接入Internet
- 常见对象_BigDecimal的加减乘除法的使用
- Android 中使用MediaRecorder进行录像详解(视频录制)
- Codeforces 742C C. Arpa's loud Owf and Mehrdad's evil plan
- Bootstrap学习总结笔记(22)-- 基本插件之折叠
- java操作mysql时执行带有日期语句的误区