编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#104997 #1280. zxh的均分继承法 Compile Error 0 0 ms 0 K Java / 771 B Shirost 2024-07-01 23:06:18
显示原始代码
import java.util.*;
class point {
    int a, b;
    public point(int a, int b) {
        this.a = a;
        this.b = b;
    }
}

class Comp implements Comparator<point> {
    @Override
    public int compare(point x, point y) {
        return y.a * x.b - x.a * y.b;
    }
}
public class b {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<point> s = new ArrayList<>();
        int n = sc.nextInt();
        for (int i = 1; i <= n; ++i) {
            int a = sc.nextInt(), b = sc.nextInt();
            s.add(new point(a, b));
        }
        sc.close();
        Collections.sort(s, new Comp());
        for (int i = 0; i < n; ++i) System.out.println(s.get(i).a + "\\" + s.get(i).b);
    }
}

编译信息

Can't open /dev/null: No such file or directory
Main.java:16: error: class b is public, should be declared in a file named b.java
public class b{
       ^
1 error