#P8766. [蓝桥杯 2021 国 AB] 异或三角
[蓝桥杯 2021 国 AB] 异或三角
Problem Description
Given numbers , for each , find how many triples satisfy:
-
;
-
, where denotes bitwise XOR in binary;
-
The three sides with lengths can form a triangle.
Input Format
The first line contains an integer .
The next lines each contain an integer, representing .
Output Format
Output lines, each containing an integer, representing the corresponding answer.
2
6
114514
6
11223848130
Hint
For of the testdata, , .
For of the testdata, , .
For of the testdata, , .
For of the testdata, , .
For all testdata, , .
Lanqiao Cup 2021 National Contest, Group A Problem I (Group B Problem J).
Translated by ChatGPT 5