Compile Error
Main.java:3: error: class MyClass is public, should be declared in a file named MyClass.java public class MyClass { ^ 1 error
Code
import java.util.Scanner;
public class MyClass {
static Scanner in = new Scanner(System.in);
static int h, w;
static void solve() {
long sum = 0L;
for(int i = 1; i <= Math.min(w, h); ++i) {
sum += (h - i + 1) * (w - i + 1);
}
System.out.println(sum);
}
public static void main(String args[]) {
input();
solve();
}
private static void input() {
h = in.nextInt();
w = in.nextInt();
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1121 Square Counting Challenge
- Contest
- Brain Booster #7
- Language
- Java 8 (OpenJDK 1.8.0_422)
- Submit At
- 2024-11-05 14:59:40
- Judged At
- 2024-11-11 02:31:53
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes