# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
120379 | zeyad49 | Kocka (COCI18_kocka) | Java | 519 ms | 56368 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
import java.io.*;
import java.util.*;
public class kocka {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner();
PrintWriter out = new PrintWriter(System.out);
int n = sc.nextInt();
int[] L = new int[n];
for (int i = 0; i < n; i++)
L[i] = sc.nextInt();
boolean ok = true;
int[] first = new int[n], last = new int[n];
Arrays.fill(first, -1);
Arrays.fill(last, -1);
for (int row = 0; row < n; row++) {
int r = sc.nextInt(), l = L[row];
if (l == -1 || r == -1) {
ok &= l == r;
} else {
r = n - r - 1;
if (l > r)
ok = false;
if (first[l] == -1)
first[l] = row;
last[l] = row;
if (first[r] == -1)
first[r] = row;
last[r] = row;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |