RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00395

Ozljeda

Unrated 레이팅 미적용
난이도
1s
시간 제한
64MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

\(7^{th}\) round, March \(5^{th}\) 2016
Due to the frantical usage of the racket to kill flies, Marin has sustained a serious bodily injury known
to the medical community as epicondylitis lateralis humeri. His grandma has advised smearing rakija
over it, the doctor has prescribed a strong painkiller, but Marin has ignored every single advice and
decided to look for the answer in integer sequences.
He has discovered a previously undiscovered sequence of integers and called it the xorbonacci sequence.
The \(n\)^{th} element in the sequence is denoted with \(x_{n}\). The sequence is defined recursively in the following
way:
\(x@@RISE_MATH_BLOCK_0@@n = x@@RISE_MATH_BLOCK_1@@n - 2\) ⊕... ⊕\(x_{n}\){−}, \(n > k\)
Because of a reason only known to Marin, he determined that all his sorrows will go away if you answer
his \(Q\) queries defined with numbers \(l\) and \(r\). The answer to the query is represented with the value
\(x_{l}\)\(x_{l}\)_{+1} ⊕... ⊕\(x@@RISE_MATH_BLOCK_2@@r\)
Help Marin and answer his queries.
Please note: The operation ⊕is the operation of binary XOR.

제약
입력 형식

The first line of input contains the integer \(K\) (1 ⩽\(K\) ⩽100 000) from the task.
The following line contains \(K\) integers that represent the first \(K\) elements in the xorbonacci sequence.
All numbers are smaller than \(10^{18}\).
The following line contains the integer \(Q\) (1 ⩽\(Q\)\(10^{6}\)) from the task.
The \(i\)^{th} of the following \(Q\) lines contains two integers \(l_{i}\) and \(r_{i}\) (1 ⩽\(l_{i}\)\(r_{i}\)\(10^{18}\)) that represent
Marin’s \(i\)^{th} query.

출력 형식

Each of the following \(Q\) lines of output must contain the answers to Marin’s queries, the order being
the same as the input.

예제 1
입력
4
1 3 5 7
3
2 2
2 5
1 5
5
3 3 4 3 2
4
1 2
1 3
5 6
7 9
출력
output
3
1
0
0
4
7
4
문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2015/2016 Contest 7

평가 및 의견

Ozljeda

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Ozljeda

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8