2 条题解
-
0
暴力for 重要的是不等式两边开根号
static int count = 0; public static boolean check(int num) { for (int i = 2; i < num; i++) { if(num%i==0) { return false; } } return true; } public static void main(String[] args) { int k = 0; for (int i = 2; i < 20250309; i++) { for (int j = 2; j < 20250309; j++) { if(j*Math.sqrt((double)(i*j))>Math.sqrt((double)20250309)) { break; } if(j<i) { continue; } if(check(i)&&check(j)&&i<j&&i*j*j*j<20250309) { count++; } } } System.out.println(count); } }
信息
- ID
- 301
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 6
- 标签
- 递交数
- 131
- 已通过
- 41
- 上传者