标签:style blog color java for ar div log sp
省点心,直接列出来了……
1 import java.util.Arrays; 2 import java.util.Scanner; 3 4 public class P1209 5 { 6 public static void main(String args[]) 7 { 8 long k[] = new long[100000]; 9 for (int i = 1; i < k.length; i++) 10 k[i] = (long) i * (i + 1) / 2; 11 try (Scanner cin = new Scanner(System.in)) 12 { 13 while (cin.hasNext()) 14 { 15 int n = cin.nextInt(); 16 for (int i = 0; i < n; i++) 17 { 18 long x = cin.nextInt(); 19 if (x == 1) 20 System.out.println(1); 21 else if (Arrays.binarySearch(k, x - 1) >= 0) 22 System.out.println(1); 23 else 24 System.out.println(0); 25 } 26 } 27 } 28 } 29 }
标签:style blog color java for ar div log sp
原文地址:http://www.cnblogs.com/gwhahaha/p/3936361.html