{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eA bitwise OR takes two equal-length binary representations and performs the logical OR operation on each pair of the corresponding bits. The result in each position is $$$0$$$ if both bits are $$$0$$$, while otherwise, the result is $$$1$$$. The bitwise OR operation is represented in this problem, and also in programming languages such as C++ and Java, using the operator \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e|\u003c/span\u003e\".\u003c/p\u003e\u003cp\u003eTo get the value of $$$x\\,|\\,y$$$, consider both numbers in the binary representation (padded with zeros to make their lengths equal), then apply the OR operation on the corresponding bits, and return the result into decimal form. For example, the result of $$$10\\,|\\,17$$$ \u003d $$$01010\\,|\\,10001$$$ \u003d $$$11011$$$ \u003d $$$27$$$.\u003c/p\u003e\u003cp\u003eYou are given an array $$$a$$$ of $$$n$$$ integers. A subarray of the array $$$a$$$ is a sequence $$$a_l, a_{l + 1}, \\cdots, a_r$$$ for some integers ($$$l,\\,r$$$) such that $$$1 \\le l \\le r \\le n$$$.\u003c/p\u003e\u003cp\u003eThe subarray OR is defined as the the bitwise OR of all elements inside that subarray. Formally, the subarray OR of the subarray ($$$l,\\,r$$$) is $$$a_l\\,|\\,a_{l + 1}\\,|\\,\\cdots\\,|\\,a_r$$$.\u003c/p\u003e\u003cp\u003eYour task is to find the subarrays OR values of all subarrays in the given array and return the number of \u003cspan class\u003d\"tex-font-style-bf\"\u003eunique\u003c/span\u003e values among them. Can you?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains an integer $$$T$$$ ($$$1 \\le T \\le 5$$$) specifying the number of test cases.\u003c/p\u003e\u003cp\u003eThe first line of each test case contains an integer $$$n$$$ ($$$1 \\le n \\le 10^5$$$) giving the size of an array $$$a$$$. Then a line follows contains $$$n$$$ integers $$$a_1, \\cdots, a_n$$$ ($$$0 \\le a_i \\le 10^9$$$), giving the array $$$a$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, print a single line containing the number of \u003cspan class\u003d\"tex-font-style-bf\"\u003eunique\u003c/span\u003e subarrays OR values among the subarray OR values of all subarrays in the given array.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\n3\n1 2 3\n3\n2 4 8\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n6\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test case, there are $$$6$$$ subarrays in the given array $$$a$$$. The subarray OR of these subarrays is calculated as follows: \u003c/p\u003e\u003col\u003e \u003cli\u003e ($$$1,\\,1$$$) $$$\\rightarrow$$$ $$$1$$$. \u003c/li\u003e\u003cli\u003e ($$$1,\\,2$$$) $$$\\rightarrow$$$ $$$1\\,|\\,2 \u003d 3$$$. \u003c/li\u003e\u003cli\u003e ($$$1,\\,3$$$) $$$\\rightarrow$$$ $$$1\\,|\\,2\\,| 3 \u003d 3$$$. \u003c/li\u003e\u003cli\u003e ($$$2,\\,2$$$) $$$\\rightarrow$$$ $$$2$$$. \u003c/li\u003e\u003cli\u003e ($$$2,\\,3$$$) $$$\\rightarrow$$$ $$$2\\,|\\,3 \u003d 3$$$. \u003c/li\u003e\u003cli\u003e ($$$3,\\,3$$$) $$$\\rightarrow$$$ $$$3$$$. \u003c/li\u003e\u003c/ol\u003e\u003cp\u003eSo, the number of \u003cspan class\u003d\"tex-font-style-bf\"\u003eunique\u003c/span\u003e values among all subarrays is $$$3$$$.\u003c/p\u003e"}}]}