当前位置:网站首页>Grid segmentation
Grid segmentation
2022-07-26 08:30:00 【StephenYYYou】



package lanqiao;
/**
* Created by ministrong on 2020/2/27.
*
title : Grid segmentation
6x6 Of the lattice , Cut in two along the edge of the grid .
The shape of the two parts should be exactly the same .
Pictured :p1.png, p2.png, p3.png It's a feasible segmentation .
Try to calculate :
Including this 3 The method of seed division is inside , How many different segmentation methods are there .
Be careful : Rotationally symmetric belongs to the same segmentation method .
Please submit the integer , Don't fill in any superfluous content or explanatory text .
answer :509
*/
import java.util.ArrayList;
import java.util.Arrays;
/**
*
* Consider cutting grids to achieve , From the center point , The pointer a Take a step , The pointer b Take a step in its central symmetry , until a Go to the border , here b Also at the same time to the border .
* The cut figure must be feasible , Just divide the final result by 4, Because I want to go to the rotationally symmetrical repetition
*
* Ps: The pointer cannot go back
*
*/
public class Q4_2017_8_fanggefenge {
public static int res=0;
public static void main(String[] args) {
int[][] a=new int[7][7];
compute(a,3,3);
System.out.println(res/4);
}
public static void compute(int[][] a,int i,int j){
if(i>=6 || i<=0 || j>=6 || j<=0) res++;
else{
if(a[i][j]==1) return;
else{
a[i][j]=1;
a[6-i][6-j]=1;
compute(a,i+1,j);
compute(a,i-1,j);
compute(a,i,j+1);
compute(a,i,j-1);
a[i][j]=0;
a[6-i][6-j]=0;
}
}
}
}
边栏推荐
- Share high voltage ultra low noise LDO test results
- 分享高压超低噪声LDO测试结果(High Voltage Ultra-low Noise LDO)
- C# 获取选择文件信息
- 2022/7/11 exam summary
- A little awesome, 130000 a month+
- Shell第二天作业
- Lesson 3: gcc compiler
- Take out brother is the biggest support in this society
- Shell homework the next day
- [time complexity, space complexity]
猜你喜欢

Lesson 3: gcc compiler

Super nice navigation page (static page)

On some concepts involved in journal papers compilation + journal query methods

为什么要在时钟输出上预留电容的工位?

Kotlin data type

Uninstallation of dual systems

QT note 2

2022-7-8 personal qualifying 5 competition experience (supplementary)

Write common API tools swagger and redoc

内存管理-动态分区分配方式模拟
随机推荐
Error handling response: Error: Syntax error, unrecognized expression: .c-container /deep/ .c-contai
2022/7/12 exam summary
The first ide overlord in the universe, replaced...
QT uses QSS to make a beautiful login interface (hand-in-hand teaching)
BGP routing principle
OSPF summary
22-07-16 personal training match 3 competition experience
外卖小哥,才是这个社会最大的托底
sed作业
Nodejs2day(nodejs的模块化,npm下载包,模块加载机制)
Let's talk about the three core issues of concurrent programming.
Differences and connections of previewkeydown, Keydown, keypress and Keyup in C WinForm
关于期刊论文所涉及的一些概念汇编+期刊查询方法
flex三列布局
请问flink sql client 在sink表,有什么办法增大写出速率吗。通过sink表的同步时
2022/7/9 exam summary
Burp suite Chapter 6 how to use burp spider
Date and time function of MySQL function summary
mysql函数汇总之日期和时间函数
SPSS uses kmeans, two-stage clustering and RFM model to study the behavior law data of borrowers and lenders in P2P network finance