← All problemsSign in

XOR N-bonacci Sequence

CodeChefRating 1552Open on judge ↗

[Vietnamese](https://www.codechef.com/download/translated/COOK104/vietnamese/NBONACCI.pdf) and [Bengali](https://www.codechef.com/download/translated/COOK104/bengali/NBONACCI.pdf) as well. An *$N$-bonacci sequence* is an infinite sequence $F_1, F_2, \ldots$ such that for each integer $i \gt N$, $F_i$ is calculated as $f(F_{i-1}, F_{i-2}, \ldots, F_{i-N})$, where $f$ is some function. A *XOR $N$-b

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start