Logo
(追記) (追記ここまで)

11840번 - XOR 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 256 MB143504546.392%

문제

You are given numbers N, x and a sequence of N numbers. Find the largest possible interval of consequently following elements, such that "xor"of these elements is not less than x. I.e., more formally, find such i and k that

ai ⊕ ai+1 ⊕ · · · ⊕ ai+k−1 ≥ x, 1 ≤ i ≤ i + k − 1 ≤ N, and k is largest possible positive number.

It's guaranteed that for each test from the testset such an interval exists.

We remind you that xor(⊕) operation is applied to numbers in binary representation, so that for each pair of bits the following is true:

  • 0 ⊕ 0 = 0
  • 0 ⊕ 1 = 1
  • 1 ⊕ 0 = 1
  • 1 ⊕ 1 = 0

The result of this operation doesn't depend on the order of operands a⊕b = b⊕a. Moreover (a⊕(a⊕b)) = b.

In Pascal this operation is represented as xor. In C/C++/Java as ∧.

입력

The first line of input contains N (1 ≤ N ≤ 250 000) and x (0 ≤ x ≤ 1 000 000 000). The second line of input contains N non-negative numbers not exceeding 109.

출력

The first line of output must contain two numbers: i and k. In case of many solutions output the one with the smallest i.

제한

예제 입력 1

4 6
6 1 2 4

예제 출력 1

2 3

힌트

출처

Olympiad > International Zhautykov Olympiad > IZhO 2012 C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /