自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 收藏
  • 关注

原创 马的遍历——搜索(bfs/dfs)

题目描述有一个n*m的棋盘(1<n,m<=400),在某个点上有一个马,要求你计算出马到达棋盘上任意一个点最少要走几步输入格式一行四个数据,棋盘的大小和马的坐标输出格式一个n*m的矩阵,代表马到达某个点最少要走几步(左对齐,宽5格,不能到达则输出-1)输入输出样例输入3 3 1 1输出0 3 23 -1 12 1 4题意:在一个二维数组中,马到每一个坐标所需要的步数是多少,若无法到达,则为-1。题解:首先要确定马可

2021-03-27 17:08:27 746

原创 HDU - 5879

Given an integer n, we only want to know the sum of 1/k^2 where k from 1 to n.InputThere are multiple cases.For each test case, there is a single line, containing a single positive integer n.The input file is at most 1M.OutputThe required sum, r.

2020-12-10 19:28:24 119

原创 LightOJ - 1008

Fibsieve had a fantabulous (yes, it’s an actual word) birthday party this year. He had so many gifts that he was actually thinking of not having a party next year.Among these gifts there was an N x N glass chessboard that had a light in each of its cells.

2020-12-09 21:24:01 163

原创 LightOJ - 1010

Given an m x n chessboard where you want to place chess knights. You have to find the number of maximum knights that can be placed in the chessboard such that no two knights attack each other.Those who are not familiar with chess knights, note that a che.

2020-12-08 20:07:23 179

原创 HDU - 2138

Give you a lot of positive integers, just to find out how many prime numbers there are.InputThere are a lot of cases. In each case, there is an integer N representing the number of integers to find. Each integer won’t exceed 32-bit signed integer, and.

2020-12-07 20:34:05 126

原创 POJ - 2586

Accounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data for preparing annual report for MS Inc.All what they remember is that MS Inc. posted a surplus or a deficit each month of 1999 and each month when MS Inc. po.

2020-12-07 19:30:09 205

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除