随笔分类 -  数据结构

STL next_permutation(a,a+n) 生成一个序列的全排列。满足可重集。
摘要:/** 题目: 链接: 题意: 思路: */ #include #include #include #include #include #include using namespace std; typedef long long LL; const int mod=1e9+7; const int maxn=1e2+5; const double eps = 1e-12; in... 阅读全文

posted @ 2017-05-24 12:36 hnust_accqx 阅读(462) 评论(0) 推荐(0)

Play on Words UVA - 10129 欧拉路径
摘要:关于欧拉回路和欧拉路径 定义:欧拉回路:每条边恰好只走一次,并能回到出发点的路径欧拉路径:经过每一条边一次,但是不要求回到起始点 ①首先看欧拉回路存在性的判定: 一、无向图每个顶点的度数都是偶数,则存在欧拉回路。 二、有向图(所有边都是单向的)每个节顶点的入度都等于出度,则存在欧拉回路。 ②.欧拉路 阅读全文

posted @ 2017-05-24 11:16 hnust_accqx 阅读(174) 评论(0) 推荐(0)

Ordering Tasks UVA - 10305 图的拓扑排序
摘要:John has n tasks to do. Unfortunately, the tasks are not independent and the execution of one task is only possible if other tasks have already been e 阅读全文

posted @ 2017-05-24 10:21 hnust_accqx 阅读(190) 评论(0) 推荐(0)

2017计蒜之道 初赛 第二场 百度的科学计算器(简单)
摘要:/** 题目:2017计蒜之道 初赛 第二场 百度的科学计算器(简单) 链接:https://nanti.jisuanke.com/t/15504 题意:给一个合法的表达式,包含加号+、减号-、括号()、数字常量,表达式中没有空格。 输入数据保证数字常量以及计算过程中数值绝对值均不超过 10^12​​,对于浮点型数值常量,保证小数点后不超过 6位。 思路:暴力模拟;python有函数可以直... 阅读全文

posted @ 2017-05-22 11:03 hnust_accqx 阅读(230) 评论(0) 推荐(0)

Tree UVA - 548 已知中序遍历和后序遍历,求这颗二叉树。
摘要:You are to determine the value of the leaf node in a given binary tree that is the terminal node of a path of least value from the root of the binary 阅读全文

posted @ 2017-05-20 18:22 hnust_accqx 阅读(324) 评论(0) 推荐(0)

Trees on the level UVA - 122 复习二叉树建立过程,bfs,queue,strchr,sscanf的使用。
摘要:Trees are fundamental in many branches of computer science (Pun definitely intended). Current state- of-the art parallel computers such as Thinking Machines’ CM-5 are based on fat trees . Quad- and o... 阅读全文

posted @ 2017-05-17 13:50 hnust_accqx 阅读(233) 评论(0) 推荐(0)

导航