10208_Betsy'sTour

2022-5-16 18:16| 发布者: Hocassian| 查看: 70| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504661647300-Problem List-采集的数据-后羿采集器.html

Pro.ID

10208

Title

Betsy's Tour

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10208

AC

24

Submit

36

Ratio

66.67%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    A square township has been divided up into N2 square plots (1 ≤ N ≤ 7). The Farm is located in the upper left plot and the Market is located in the lower left plot. Betsy takes her tour of the township going from Farm to Market by walking through every plot exactly once. Shown below is one possible tour for Betsy when N=3.

    ----------------
    |    |    |    |
    | F**********  |
    |    |    | *  |
    ------------*---
    |    |    | *  |
    |  *****  | *  |
    |  * | *  | *  |
    ---*---*----*---
    |  * | *  | *  |
    |  M | ******  |
    |    |    |    |
    ----------------

    Write a program that will count how many unique tours Betsy can take in going from Farm to Market for any value of N.

    输入

    Line 1:   A single integer N (1 ≤ N ≤ 7)

    输出

    Description

    A square township has been divided up into N2 square plots (1 ≤ N ≤ 7). The Farm is located in the upper left plot and the Market is located in the lower left plot. Betsy takes her tour of the township going from Farm to Market by walking through every plot exactly once. Shown below is one possible tour for Betsy when N=3.

    ----------------
    |    |    |    |
    | F**********  |
    |    |    | *  |
    ------------*---
    |    |    | *  |
    |  *****  | *  |
    |  * | *  | *  |
    ---*---*----*---
    |  * | *  | *  |
    |  M | ******  |
    |    |    |    |
    ----------------

    Write a program that will count how many unique tours Betsy can take in going from Farm to Market for any value of N.

    Input

    Line 1:   A single integer N (1 ≤ N ≤ 7)

    Output

    A single line with a single integer, the number of unique tours.

    Sample Input

    3

    Sample Output

    2

    Source

    样例输入

    3

    样例输出

    2

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部