Hello! I am trying to submit this simple problem But getting below error: Error occurred during initialization of VM Initial heap size set to a larger value than the maximum heap size Any suggestion welcome! Thanks.
Code
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3839 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3612 |
7 | Geothermal | 3569 |
8 | ecnerwala | 3494 |
9 | Um_nik | 3396 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | Um_nik | 164 |
2 | -is-this-fft- | 162 |
2 | maomao90 | 162 |
4 | atcoder_official | 158 |
4 | cry | 158 |
4 | awoo | 158 |
7 | nor | 155 |
7 | adamant | 155 |
9 | TheScrasse | 153 |
10 | maroonrk | 152 |
Why getting RTE in Java 11 submission?
Hello! I am trying to submit this simple problem But getting below error: Error occurred during initialization of VM Initial heap size set to a larger value than the maximum heap size Any suggestion welcome! Thanks.
import java.io.*;
import java.util.*;
public class P51 {
public static void main(String[] args) throws IOException {
Scanner io = new Scanner(System.in);
int n = io.nextInt();
long ans = (long) n * (n + 1) / 2;
while (n-- > 1) {
int a = io.nextInt();
ans -= a;
}
System.out.println(ans);
}
}
Rev. | Lang. | By | When | Δ | Comment | |
---|---|---|---|---|---|---|
en1 | najmul.csebuet | 2021-12-27 16:12:35 | 783 | Initial revision (published) |
Name |
---|