import static java.lang.Math.*;import java.util.*; /** * @author Sycamore * @link http://acm.hdu.edu.cn/showproblem.php?pid=5536 * @date Sep, 16 */ public class Main { public static void main(String args[]) { Scanner scanner =new Scanner(System.in); int T=scanner.nextInt(); while(T--!=0){ int n=scanner.nextInt(),ans=0; int []s=new int[n]; for(int i=0;i<n;i++){ s[i]=scanner.nextInt(); } for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ for(int k=j+1;k<n;k++){ ans=max(ans,(s[i]+s[j])^s[k]); ans=max(ans,(s[i]+s[k])^s[j]); ans=max(ans,(s[j]+s[k])^s[i]); } } } System.out.println(ans); } }}
pasting
时间: 2024-10-13 11:31:24