4 2 3 2 4 2 6 1 2 1 3
5
There are four ways to make a necklace, as follows.
* Choose the $1$\-st and $3$\-rd gemstones to make a necklace with the beautifulness of $4\ {\rm XOR}\ 2 =6$.
* Choose the $1$\-st and $4$\-th gemstones to make a necklace with the beautifulness of $4\ {\rm XOR}\ 3 =7$.
* Choose the $2$\-nd and $3$\-rd gemstones to make a necklace with the beautifulness of $6\ {\rm XOR}\ 2 =4$.
* Choose the $2$\-nd and $4$\-th gemstones to make a necklace with the beautifulness of $6\ {\rm XOR}\ 3 =5$.
Thus, the necklace with the $3$\-rd greatest beautifulness has the beautifulness of $5$.3 1 2 1 0 1 0 1 0
0 There are three ways to make a necklace, all of which result in the beautifulness of $0$.
10 3 11 1 414213562373095048 1 732050807568877293 2 236067977499789696 2 449489742783178098 2 645751311064590590 2 828427124746190097 3 162277660168379331 3 316624790355399849 3 464101615137754587 3 605551275463989293
766842905529259824
{
"problem": {
"name": "Ex - K-th beautiful Necklace",
"description": {
"content": "We have $N$ gemstones. The color and beauty of the $i$\\-th gemstone are $D_i$ and $V_i$, respectively. Here, the color of each gemstone is one of $1, 2, \\ldots, C$, and there is at least one gemston",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc252_h"
},
"statements": [
{
"statement_type": "Markdown",
"content": "We have $N$ gemstones. The color and beauty of the $i$\\-th gemstone are $D_i$ and $V_i$, respectively. \nHere, the color of each gemstone is one of $1, 2, \\ldots, C$, and there is at least one gemston...",
"is_translate": false,
"language": "English"
}
]
}