CodeForces - 1109A
#include<cstdio>
#include<map>
#include<iostream>
#include<algorithm>
using namespace std; int n;
long long ans,pre;
map<pair<int,int>,int> M;
main()
{
scanf("%d",&n);
cin>>pre;
M[{,pre}]++;
for(int i=,x;i<=n;i++){
scanf("%d",&x);
pre^=x;
ans+=M[{i&,pre}];
if(pre==&&i%==) ans++;
M[{i&,pre}]++;
}
cout<<ans<<endl;
}
CodeForces - 1109A的更多相关文章
- python爬虫学习(5) —— 扒一下codeforces题面
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...
- 【Codeforces 738D】Sea Battle(贪心)
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...
- 【Codeforces 738C】Road to Cinema
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...
- 【Codeforces 738A】Interview with Oleg
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...
- CodeForces - 662A Gambling Nim
http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...
- CodeForces - 274B Zero Tree
http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...
- CodeForces - 261B Maxim and Restaurant
http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...
- CodeForces - 696B Puzzles
http://codeforces.com/problemset/problem/696/B 题目大意: 这是一颗有n个点的树,你从根开始游走,每当你第一次到达一个点时,把这个点的权记为(你已经到过不 ...
- CodeForces - 148D Bag of mice
http://codeforces.com/problemset/problem/148/D 题目大意: 原来袋子里有w只白鼠和b只黑鼠 龙和王妃轮流从袋子里抓老鼠.谁先抓到白色老鼠谁就赢. 王妃每次 ...
随机推荐
- Linux 系统监控工具 atop
系统监控是运维工作中重要的一环,本文以 atop 工具为例来介绍系统的重要监控项. atop可以使用yum或apt包管理器进行安装.atop man page 中详细说明了 atop 中各监控项含义及 ...
- lua学习之复习汇总篇
第六日笔记 1. 基础概念 程序块 定义 在 lua 中任何一个源代码文件或在交互模式中输入的一行代码 程序块可以是任意大小的 程序块可以是一连串语句或一条命令 也可由函数定义构成,一般将函数定义写在 ...
- vuejs之vue和springboot后端进行通信
一.新建一个vue项目,建立好后的相关文件 查看一下新建好的vue项目的结构: 当前各个文件中的内容: App.vue:主入口 <template> <div id="ap ...
- who 命令
1)显示系统启动时间 [root@node1 ~]# who -b 系统引导 2020-01-10 11:41 2)显示系统当前的运行级别 [root@node1 ~]# who -r 运行级别 3 ...
- Apache安装使用笔记
下载 打开网页http://httpd.apache.org/,点击 在download页面点击 然后在新页面选择 在新窗口选择 选择32位或64位apache下载,此处下载64位的apache: h ...
- input event兼容性
<div class="wrapper"> <p>keypress - event not call on adroid</p> <inp ...
- GNU make doc - 3.8
Note that the directory prefix (D), as described in Implicit Rule Search Algorithm, is appended (aft ...
- Win10好用的快捷键
Win10好用的快捷键 Win键,Tab键,空格键,上下左右方向键,Enter键,Shift+Tab键 Win键--Tab键--上下左右方向键--Enter确定或者---空格键(确定的意思),Ente ...
- PS切图工具
缓存设置: 编辑-首选项-暂存盘 改完除了C盘之外的其他盘 单位设置: 编辑-首选项-单位与标尺 将单位修改成像素 PS预设: 工具 (窗口-工具) 标尺 (视图-标尺) 图层 (窗口-图层 ...
- sqlserver 批量修改数据库表主键名称为PK_表名
1.我们在创建sqlserver得数据表的主键的时候,有时会出现,后面加一串随机字符串的情况,如图所示: 2.如果你有强迫症的话,可以使用以下sql脚本进行修改,将主键的名称修改为PK_表名. --将 ...