跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F1261. Beautiful Subarrays

  • ID: 1267
  • 传统题
  • 2000ms
  • 256MiB
  • 尝试: 0
  • AC · 已通过: 0
  • 教学难度:提高
  • 上传者:
  • 数据结构
  • 分治
  • 字符串
  • 树
  • 算法思想
  • 提高
  • 难度
  • 共享题库
  • Codeforces
  • 英文题面
  • 题目来源
  • 题面语言

Beautiful Subarrays

题目描述

E. Beautiful Subarrays
time limit per test
3 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

One day, ZS the Coder wrote down an array of integers awith elements a1,a2,...,an.

A subarray of the array a is a sequence al,al+1,...,ar for some integers (l,r) such that 1≤l≤r≤n. ZS the Coder thinks that a subarray of a is beautiful if the bitwise xor of all the elements in the subarray is at least k.

Help ZS the Coder find the number of beautiful subarrays of a!

Input

The first line contains two integers n and k (1≤n≤106,1≤k≤109) − the number of elements in the array a and the value of the parameter k.

The second line contains n integers ai (0≤ai≤109) − the elements of the array a.

Output

Print the only integer c − the number of beautiful subarrays of the array a.

Examples
Input
3 1
1 2 3
Output
5
Input
3 2
1 2 3
Output
3
Input
3 3
1 2 3
Output
2


题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 744 题。保留原作者与原赛事署名。