[Offer收割]编程练习赛12 register

Ended

Participants:1323

Verdict:Accepted
Score:100 / 100
Submitted:2017-04-02 12:40:06

Lang:Java

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.Scanner;
public class Main {
    static int nm ,ans;
    static int maxn = 110;
    static int[] fa = new int[maxn * maxn * 4];
    static int[] sta = new int[maxn * maxn * 4];
    static char[][] s = new char[maxn][maxn];
    public static int ID(int xint yint i) {
        return (((x - 1* m + y - 1* 4 + i);
    }
    public static void read() {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        m = in.nextInt();
        in.nextLine();
        for (int i = 1i <= ni++) {
            String t = in.nextLine();
            for (int j = 1j <= mj++) {
                s[i][j= t.charAt(j - 1);
            }
        }
    }
    public static int Get_fa(int x) {
        while (fa[x!= x) {
            sta[++sta[0]] = x;
            x = fa[x];
        }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX