# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
120379 | zeyad49 | Kocka (COCI18_kocka) | Java | 519 ms | 56368 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
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... |