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

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

原创 二叉树(中序,先序,后序,层次)遍历之间的相互转变
一.知道先序,中序求后序。用先序知道根节点,通过中序知道根节点的左子右子。通过一次次递归,推出最后一个。#include <iostream>#include <cstring>#define MAX 50+3using namespace std;typedef struct tree{ char data;//数据 struct tr...
2018-08-08 09:45:28
2172

原创 建二叉树的模板(指针,链表型)
首先是结构体的定义typedef struct node { struct node *leftChild; struct node *rightChild; char data; }BiTreeNode, *BiTree; 二叉树的四种遍历(先序,中序,后序,层次)1.先序void printTree3(BiTree &T)...
2018-08-08 09:32:47
241

原创 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
417

原创 对称轴(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
630

原创 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
575
原创 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
529
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人