
dfs
Exception2017
OI总结
展开
-
TOJ3988 后序遍历 (递归+STL)
问题:给一颗二叉树的前序遍历和中序遍历 ,给出后序遍历。前序遍历 根 左 右中序遍历 左 根 右后序遍历 左 右 根给一个例子:A B D E CB D E A C例子中A为根节点 A的左子树是 BDE 右子树。考虑递归。#include<bits/stdc++.h>using namespace std;string str1,str2,ans;int cnt; void solve(string a,string b){ if(a.size()==0) ret原创 2020-09-16 16:14:28 · 101 阅读 · 0 评论 -
CF1000E We Need More Bosses (tarjan + dfs)
E. We Need More Bossestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYour friend is developing a computer game. He has already ...原创 2018-11-03 11:11:44 · 206 阅读 · 0 评论 -
noip2018 day1T1 铺设道路
题目:https://www.luogu.org/problemnew/show/P5019今年noip考了一道原题:在考场上我想了暴力的方法:这题暴力可以过 #include<cstdio>#include<cstring>#include<algorithm>#include<cmath>using namespac...原创 2018-11-24 20:01:38 · 406 阅读 · 0 评论