# 75. 矩形覆盖

java

```java
/**
 * 矩形覆盖
 *
 * 我们可以用2*1的小矩形横着或者竖着去覆盖更大的矩形。
 * 请问用n个2*1的小矩形无重叠地覆盖一个2*n的大矩形，总共有多少种方法？
 *
 */
public class RectCoverSolution {
    public int RectCover(int target) {
        if(target==0) return 0;
        if(target==1||target==2) return target;
        int i=3;
        int tmp1=1;
        int tmp2=2;
        int v=0;
        while (i<=target){
            v=tmp1+tmp2;
            tmp1=tmp2;
            tmp2=v;
            i++;
        }
        return v;
    }

    public static void main(String[] args) {
        int target=4;
        int r = new RectCoverSolution().RectCover(target);
        System.out.println(r);
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://im-qianuxn.gitbook.io/pytorch/ji-suan-ji/shua-ti/zhi-shang-lei/75-ju-xing-fu-gai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
