请问随机算法这样可以吗,还是底层啊? public static void main(String[] args) { HashSet hashSet = new HashSet(); Random random = new Random((long)(5*10e8)-1); int to = (int) (10*10e4); System.out.println(to); while (to>0) { long a = random.nextLong(); a = a>0?a:-a; if (!hashSet.contains(a)) { hashSet.add(a); System.out.println(a); to--; } } System.out.println(hashSet.size()); }