# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
498169 | mo13561 | Crossing (JOI21_crossing) | Java | 1798 ms | 28656 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.util.HashSet;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(); sc.nextLine(); String a = sc.nextLine(); String b = sc.nextLine(); String c = sc.nextLine(); int q = sc.nextInt(); sc.nextLine();
char[] t = sc.nextLine().trim().toCharArray();
int[][] cases = new int[q][2];
char[] change = new char[q];
for (int i = 0; i < q; ++i) {
cases[i][0] = sc.nextInt() - 1;
cases[i][1] = sc.nextInt() - 1;
change[i] = sc.next().charAt(0);
}
int inf = (int) Math.pow(10,9);HashSet<String> set = new HashSet<>();
String[][][] dp = new String[18][18][18];
dp[1][0][0] = a;
dp[0][1][0] = b;
dp[0][0][1] = c;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 3; k++) {
if (i == 0 && j ==0 && k == 0) continue;
dp[i + 1][j][k] = cross(dp[i][j][k], a);
dp[i][j + 1][k] = cross(dp[i][j][k], b);
dp[i][j][k + 1] = cross(dp[i][j][k], c);
}
}
}
# | 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... |