| Task: | Massive Matrices |
| Sender: | thierry |
| Submission time: | 2018-09-13 18:31:28 +0300 |
| Language: | Java |
| Status: | READY |
| Result: | RUNTIME ERROR |
| test | verdict | time | |
|---|---|---|---|
| #1 | RUNTIME ERROR | 0.14 s | details |
| #2 | RUNTIME ERROR | 0.15 s | details |
| #3 | RUNTIME ERROR | 0.15 s | details |
| #4 | RUNTIME ERROR | 0.16 s | details |
| #5 | RUNTIME ERROR | 0.15 s | details |
| #6 | RUNTIME ERROR | 0.15 s | details |
| #7 | RUNTIME ERROR | 0.15 s | details |
| #8 | RUNTIME ERROR | 0.14 s | details |
| #9 | RUNTIME ERROR | 0.14 s | details |
| #10 | RUNTIME ERROR | 0.14 s | details |
| #11 | RUNTIME ERROR | 0.14 s | details |
| #12 | RUNTIME ERROR | 0.14 s | details |
| #13 | RUNTIME ERROR | 0.14 s | details |
| #14 | RUNTIME ERROR | 0.14 s | details |
| #15 | RUNTIME ERROR | 0.14 s | details |
| #16 | RUNTIME ERROR | 0.14 s | details |
| #17 | RUNTIME ERROR | 0.15 s | details |
| #18 | RUNTIME ERROR | 0.14 s | details |
| #19 | RUNTIME ERROR | 0.14 s | details |
| #20 | RUNTIME ERROR | 0.14 s | details |
| #21 | RUNTIME ERROR | 0.14 s | details |
| #22 | RUNTIME ERROR | 0.14 s | details |
| #23 | RUNTIME ERROR | 0.54 s | details |
| #24 | RUNTIME ERROR | 0.54 s | details |
| #25 | RUNTIME ERROR | 0.53 s | details |
| #26 | RUNTIME ERROR | 0.54 s | details |
| #27 | RUNTIME ERROR | 0.53 s | details |
| #28 | RUNTIME ERROR | 0.52 s | details |
| #29 | RUNTIME ERROR | 0.53 s | details |
| #30 | RUNTIME ERROR | 0.53 s | details |
| #31 | RUNTIME ERROR | 0.53 s | details |
| #32 | RUNTIME ERROR | 0.53 s | details |
| #33 | RUNTIME ERROR | 0.53 s | details |
Code
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
public class Viikko2e {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
public static void main(String[] args) {
// TODO code application logic here
FastReader s = new FastReader();
int n = s.nextInt();
int[][] sudoku = new int[n][n];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
sudoku[i][j] = s.nextInt();
}
}
if (tarkista(n, sudoku)) {
System.out.println("YES");
} else {
System.out.println("NO");
}
}
private static boolean tarkista(int n, int[][] sudoku) {
Set<Integer> setti = new HashSet<>();
for (int i = 0; i < n; i++) {
for (int j = 0; i < n; i++) {
int a = sudoku[i][j];
if (setti.contains(a)) {
return false;
}
setti.add(a);
}
setti.clear();
}
for (int i = 0; i < n; i++) {
for (int j = 0; i < n; i++) {
int a = sudoku[j][i];
if (setti.contains(a)) {
return false;
}
setti.add(a);
}
}
return true;
}
}
Test details
Test 1
Verdict: RUNTIME ERROR
| input |
|---|
| 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 2
Verdict: RUNTIME ERROR
| input |
|---|
| 10 10 10 10 10 10 10 10 10 10 10 0 0 0 0 0 0 0 0 0 0 |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 3
Verdict: RUNTIME ERROR
| input |
|---|
| 10 0 0 0 0 0 0 0 0 0 0 10 10 10 10 10 10 10 10 10 10 |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 4
Verdict: RUNTIME ERROR
| input |
|---|
| 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 |
| correct output |
|---|
| 100 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 5
Verdict: RUNTIME ERROR
| input |
|---|
| 10 3 4 4 4 5 5 6 10 10 10 0 0 0 0 0 0 0 0 0 0 |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 6
Verdict: RUNTIME ERROR
| input |
|---|
| 10 0 3 4 5 6 6 7 7 7 7 10 10 10 10 10 10 10 10 10 10 |
| correct output |
|---|
| 90 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 7
Verdict: RUNTIME ERROR
| input |
|---|
| 10 0 0 0 0 0 0 0 0 0 0 0 0 2 3 7 8 9 10 10 10 |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 8
Verdict: RUNTIME ERROR
| input |
|---|
| 10 10 10 10 10 10 10 10 10 10 10 1 4 4 5 5 5 5 7 9 9 |
| correct output |
|---|
| 90 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 9
Verdict: RUNTIME ERROR
| input |
|---|
| 10 1 2 5 5 5 5 6 6 10 10 0 0 3 5 6 7 7 7 7 10 |
| correct output |
|---|
| 58 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 10
Verdict: RUNTIME ERROR
| input |
|---|
| 10 0 0 0 1 1 1 2 4 6 8 0 1 1 1 4 4 4 4 4 5 |
| correct output |
|---|
| 10 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 11
Verdict: RUNTIME ERROR
| input |
|---|
| 10 2 4 4 4 5 5 6 6 8 9 0 0 0 1 1 2 7 7 8 10 |
| correct output |
|---|
| 24 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 12
Verdict: RUNTIME ERROR
| input |
|---|
| 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 13
Verdict: RUNTIME ERROR
| input |
|---|
| 100 100 100 100 100 100 100 100 10... |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 14
Verdict: RUNTIME ERROR
| input |
|---|
| 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 15
Verdict: RUNTIME ERROR
| input |
|---|
| 100 100 100 100 100 100 100 100 10... |
| correct output |
|---|
| 10000 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 16
Verdict: RUNTIME ERROR
| input |
|---|
| 100 0 0 0 0 4 6 7 8 9 11 12 12 13 ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 17
Verdict: RUNTIME ERROR
| input |
|---|
| 100 0 0 3 5 6 6 8 8 8 10 14 15 15 ... |
| correct output |
|---|
| 9800 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 18
Verdict: RUNTIME ERROR
| input |
|---|
| 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 19
Verdict: RUNTIME ERROR
| input |
|---|
| 100 100 100 100 100 100 100 100 10... |
| correct output |
|---|
| 9400 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 20
Verdict: RUNTIME ERROR
| input |
|---|
| 100 2 3 5 5 7 9 9 11 11 11 11 15 1... |
| correct output |
|---|
| 6080 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 21
Verdict: RUNTIME ERROR
| input |
|---|
| 100 1 2 2 3 6 6 6 6 8 11 12 12 12 ... |
| correct output |
|---|
| 5154 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 22
Verdict: RUNTIME ERROR
| input |
|---|
| 100 0 0 3 3 3 4 4 5 6 8 9 9 11 11 ... |
| correct output |
|---|
| 4813 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.NullPointerException at java.base/java.util.StringTo...
Test 23
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at Viikko2e.main(V...
Test 24
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 200000 200000 200000 200000 20... |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at Viikko2e.main(V...
Test 25
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at Viikko2e.main(V...
Test 26
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 200000 200000 200000 200000 20... |
| correct output |
|---|
| 40000000000 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at Viikko2e.main(V...
Test 27
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 0 0 0 0 0 2 2 3 3 4 5 5 7 7 7 ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at Viikko2e.main(V...
Test 28
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 1 1 6 6 6 8 10 10 10 10 12 12 ... |
| correct output |
|---|
| 40000000000 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at Viikko2e.main(V...
Test 29
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at Viikko2e.main(V...
Test 30
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 200000 200000 200000 200000 20... |
| correct output |
|---|
| 40000000000 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at Viikko2e.main(V...
Test 31
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 1 1 1 1 4 5 5 5 5 6 7 7 7 8 11... |
| correct output |
|---|
| 19983276438 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at Viikko2e.main(V...
Test 32
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 0 3 3 5 8 9 9 11 11 11 14 14 1... |
| correct output |
|---|
| 20009052076 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at Viikko2e.main(V...
Test 33
Verdict: RUNTIME ERROR
| input |
|---|
| 200000 0 0 0 0 3 4 4 4 4 4 6 6 8 8 10... |
| correct output |
|---|
| 19996936012 |
| user output |
|---|
| (empty) |
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at Viikko2e.main(V...
