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

Ended

Participants:405

Verdict:Accepted
Score:100 / 100
Submitted:2017-07-23 13:51:10

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
// package hihocoder.Offer_2017_0723;
import java.io.*;
import java.util.*;
/**
 * Created by yanghui on 2017/3/5.
 */
public class Main {
    FastIO scan = new FastIO();
    public boolean match(char[][] data , char[][] current , int idx , int idy){
        int N = data.length;
        int M = data[0].length;
        int H = current.length;
        int W = current[0].length;
        int m = M / 2;
        for(int i = 0 ; i < Math.min(N , H) ; i ++){
            for(int j = 0 ; j < Math.min(m , W) ; j ++){
                if(current[i][j!= data[(idx + i% N][(idy + j% m]) return false;
            }
        }
        return true;
    }
    public boolean match(char[][] data , char[][] current){
        int N = data.length;
        int M = data[0].length;
        int H = current.length;
        int W = current[0].length;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX