自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 向右看齐 (排序问题)

新学年开始了。有一批新生要军训了。休息时间到了,同学们站在自己喜欢的位置。每个位置由整数坐标(x,y)表示。同学们可以向前、向后、向左、向右移动一步,但在同一时刻任一位置点上只能有一名同学。按照教官的指令“向右看齐”,同学们要整齐地列成一个水平队列,即排列成(x,y),(x+1,y),…,(x+n-1,y)。如何选择x 和y的值才能使同学们用最少的总移动步数排成一列呢? 有请作为编程高手的你,计算...

2018-08-13 18:47:14 709

原创 二叉树(中序,先序,后序,层次)遍历之间的相互转变

一.知道先序,中序求后序。用先序知道根节点,通过中序知道根节点的左子右子。通过一次次递归,推出最后一个。#include <iostream>#include <cstring>#define MAX 50+3using namespace std;typedef struct tree{ char data;//数据 struct tr...

2018-08-08 09:45:28 2091

原创 建二叉树的模板(指针,链表型)

首先是结构体的定义typedef struct node { struct node *leftChild; struct node *rightChild; char data; }BiTreeNode, *BiTree; 二叉树的四种遍历(先序,中序,后序,层次)1.先序void printTree3(BiTree &T)...

2018-08-08 09:32:47 188

原创 D Bulbasaur | 时间限制:1 秒 | 内存限制:256M

Silph company deployed a passenger flow analysis system in a clothing store that captures photos of human faces and photos of human bodies in real time.In order to analyze the passenger flow better,...

2018-08-05 09:15:06 350

原创 对称轴(Symmetry, ACM / ICPC Seoul 2004 , UVa 1595) C语言写法

     The gure shown on the left is left-right symmetric as it is possible to fold the sheet of paper along avertical line, drawn as a dashed line, and to cut the gure into two identical halves. The g...

2018-07-28 10:13:17 544

原创 AtCoder Beginner Contest 103 D - Islands War

Time limit : 2sec / Memory limit : 1024MBScore : 400 pointsProblem StatementThere are N islands lining up from west to east, connected by N−1 bridges.The i-th bridge connects the i-th island f...

2018-07-22 09:56:32 483 1

原创 AtCoder Regular Contest 101 C-Candles

Problem StatementThere are N candles placed on a number line. The i-th candle from the left is placed on coordinate xi. Here, x1<x2<…<xN holds.Initially, no candles are burning. Snuke dec...

2018-08-27 20:41:36 480

空空如也

空空如也

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

TA关注的人

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