自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 2/1/2022 刷题总结

Leetcode最大子序列和:if sum > 0: sum += num[i]else: sum = num[i]ans = max(sum, ans)岛屿计数(DFS)for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ dfs(i, j, arr); cnt++; }}dfs(int i, int j, int[][] arr){

2022-01-02 23:57:04 107

原创 笔记20210708

NC22合并两个有序的数组给出一个整数数组A和有序的整数数组B,请将数组B合并到数组A中,变成一个有序的升序数组注意:1.可以假设A数组有足够的空间存放B数组的元素,A和B中初始的元素数目分别为M和N,的数组空间大小为M+N2.不要返回合并的数组,返回是空的,将数组B的数据合并到A里面就好了3.数组在[0,m-1]的范围也是有序的例1:A:[1,2,3,0,0,0],m=3B: [2,5,6],n=3合并过后A为:A: [1,2,2,3,5,6]从大到小...

2021-07-08 21:38:39 122

原创 Leetcode刷题Day1

许久没写代码了,也不是很熟悉Leetcode的运行机制,适应了有一段时间。简简单单的两链表相加操作,主要是不是很理解自定的ListNode类,常报空指针的错误导致调试了很长时间。。。tips: 自己的代码有点啰嗦了,学习一下官方代码给出两个非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照逆序的方式存储的,并且它们的每个节点只能存储一位数字。如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和。您可以假设除了数字 0 之外,这两个数都不会以 0开头。...

2020-11-10 00:48:19 209

原创 poj 3279 Fliptile(DFS 二进制运算)-黑白棋

题目链接:http://poj.org/problem?id=3279FliptileTime Limit: 2000MS   Memory Limit: 65536K Total Submissions: 16162   Accepted: 5903 DescriptionFarmer John knows that an intellectual...

2018-08-07 18:46:43 369

原创 2018 Multi-University Training Contest 5 1005 Everything Has Changed

 Problem DescriptionEdward is a worker for Aluminum Cyclic Machinery. His work is operating mechanical arms to cut out designed models. Here is a brief introduction of his work.Assume the operating...

2018-08-07 18:44:10 146

原创 POJ 2387 Til the Cows Come Home(最短路径Dijkstra)

Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 71737   Accepted: 23963 DescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as p...

2018-08-02 17:30:31 159

原创 2018 Multi-University Training Contest 3 Problem F. Grab The Tree(博弈论&二进制运算)

 Problem DescriptionLittle Q and Little T are playing a game on a tree. There are n vertices on the tree, labeled by 1,2,...,n, connected by n−1 bidirectional edges. The i-th vertex has the value of...

2018-07-31 17:09:41 245

原创 2018 Multi-University Training Contest 3 Problem L. Visual Cube

Problem DescriptionLittle Q likes solving math problems very much. Unluckily, however, he does not have good spatial ability. Everytime he meets a 3D geometry problem, he will struggle to draw a pic...

2018-07-31 09:18:43 132

原创 HDU 1069 Monkey and Banana(DP)

Problem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with som...

2018-07-29 21:34:46 228

原创 HDU 1024 Max Sum Plus Plus(DP)

 Problem DescriptionNow I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more dif...

2018-07-29 21:28:01 124

原创 POJ - 2251 Dungeon Master(BFS)

DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit...

2018-07-29 21:07:52 113

原创 HDU - 2612 Find a way(BFS)

 Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki. Yifenfei’s home is at the c...

2018-07-29 20:56:50 135

原创 POJ-棋盘问题(DFS)

 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n &lt;= 8 , k &lt;= ...

2018-07-29 20:53:30 235

原创 2018 Multi-University Training Contest 2 1010 Swaps and Inversions

 思路很简单, 求逆序数然后乘上x, y里面较大的那个,但是一开始只会暴力求法。。。队友写了并归然后赛后也学了并归算法,嗯感觉有一点二分的意思,据dalao说还有树状数组的方法,看了看博客还是不大懂。。。跟二进制有关就容易晕。。。要继续加油啊。Problem DescriptionLong long ago, there was an integer sequence a.Tonyfan...

2018-07-29 20:48:16 92

原创 2018 Multi-University Training Contest 1 1001 Maximum Multiple

Problem DescriptionGiven an integer n, Chiaki would like to find three positive integers x, y and z such that: n=x+y+z, x∣n, y∣n, z∣n and xyz is maximum.InputThere are multiple test cases. The f...

2018-07-25 20:24:22 137

转载 2018 Multi-University Training Contest 1 1004Distinct Values 代码学习

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3336    Accepted Submission(s): 523Problem DescriptionChiaki has an array of n positive int...

2018-07-25 20:19:37 125

原创 HDU1495 非常可乐

Problem Description大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S&lt;101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是...

2018-07-25 20:12:16 170

转载 2018 Multi-University Training Contest 1 1011 标程学习

Time ZoneTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5204    Accepted Submission(s): 878Problem DescriptionChiaki often participates ...

2018-07-24 15:34:02 137

原创 2018 Multi-University Training Contest 1 1003 Triangle Partition

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 132768/132768 K (Java/Others)Total Submission(s): 2140    Accepted Submission(s): 925Special JudgeProblem DescriptionChiaki has 3n points p...

2018-07-24 09:47:35 101

空空如也

空空如也

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

TA关注的人

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