Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
超时也就算了,给我个RunTime Error的理由import java.util.*; public class Main11 { public static void main(String[] args) { Scanner in=new Scanner(System.in); int a=in.nextInt(); long[] arr=new long[a]; for(int i=0;i<a;i++) arr[i]=in.nextLong(); if(a<4) System.out.println("The set is rejected."); else { Arrays.sort(arr); if(arr[a-1]-arr[0]<arr[1]) System.out.println("The set is rejected."); else{ boolean bb=false; for(int i=a-1;i>=2;i--) { if(arr[i]-arr[i-2]<arr[i-1]) { System.out.println("The set is accepted."); bb=true; break; } } if(!bb)System.out.println("The set is rejected."); } } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator