给定长度为 n 的正整数数组 a。称一对下标 (i,j)(1≤i<j≤n)是可行对,当且仅当 ai、aj 与 ai⊕aj 可以作为三条边构成一个非退化三角形。其中 ⊕ 表示按位异或。
求可行对的数量。
数组长度 n 满足 1≤n≤105。数组元素满足 1≤ai≤1000。
第一行包含一个正整数 n,表示数组长度。
By signing up a CodeFun2000 universal account, you can submit code and join discussions in all online judging services provided by us.