码迷,mamicode.com
首页 > 其他好文 > 详细

HDU 5536: Chip Factory

时间:2017-09-16 01:16:14      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:class   date   []   back   hdu   i++   style   factor   php   


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

 

HDU 5536: Chip Factory

标签:class   date   []   back   hdu   i++   style   factor   php   

原文地址:http://www.cnblogs.com/zjnu/p/7529288.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!