- 博客(15)
- 收藏
- 关注
原创 HDU 5938 Four Operations 想法题
题目描述:Problem Description Little Ruins is a studious boy, recently he learned the four operations!Now he want to use four operations to generate a number, he takes a string which only contains digits ‘
2016-10-31 20:17:50 770
原创 HDU 5952 Counting Cliques 暴力搜索
题目描述:Problem Description A clique is a complete graph, in which there is an edge between every pair of the vertices. Given a graph with N vertices and M edges, your task is to count the number of cliq
2016-10-30 19:57:12 2272 2
原创 Codeforces Gym 101138C Stickmen 暴力搜索+组合数
题目描述:Limak is a little bear who loves to play with graphs. Recently, he defined a new structure in a graph and called it a stickman.A stickman is a set of 7 different vertices and 6 edges. Vertices sho
2016-10-28 16:19:31 574
原创 HDU 5469 Antonidas dfs减枝
题目描述:Problem Description Given a tree with N vertices and N−1 edges. Each vertex has a single letter Ci. Given a string S, you are to choose two vertices A and B, and make sure the letters catenated o
2016-10-26 21:04:34 311
原创 UVA 6907 Body Building Tarjan找桥
题目描述: 题目分析:给定一个哑铃图的定义:由两个相同的完全图和一个桥构成。如题目描述的A图B图和C图。 给一个图(有可能不连通),求有多少个哑铃图。这题的n和m太小了,所以可以暴力每一条边,把这条边当做桥。 也可以用tarjan求桥。 最后就是判定桥两边的子图是否是相同的完全图,也就是他们的边数和点数是否相等,并且边数和点数满足完全图条件就可以。 分别以桥的两个端点,一个当做
2016-10-24 21:14:22 296
原创 UVA 6906 Cluster Analysis 水
题目描述: 题目分析:给一个n个数的序列,和一个数k,在这n个数中寻找多少个集合,其中所有数的差不超过k。排序,贪心找就可以。代码如下:#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>const int MAXN=110;using namespace std;int T,n,k;in
2016-10-24 21:02:18 265
原创 UVA 6910 Cutting Tree 并查集
题目描述:Tree in graph theory refers to any connected graph (of nodes and edges) which has no simple cycle, while forest corresponds to a collection of one or more trees. In this problem, you are given a f
2016-10-21 12:40:07 375
原创 HDU 2977 Color Squares BFS
题目描述:Problem Description You have a 3 * 3 board of color squares. Each square is either empty or has a block in it. Initially, all the squares are empty. There are four kinds of blocks: blue (B), red
2016-10-18 21:53:14 344
原创 二分图染色模板
#include <iostream>#include <cstdio>#include <cstring>#include <vector>using namespace std;const int MAX_V = 205;vector<int> G[MAX_V]; // 图int V; // 顶点数int color[MAX_V]; //
2016-10-17 19:28:37 847
原创 UVA 6862 Triples 想法题
题目描述:Mr. A invites you to solve the following problem: “Let be m and n two positive integers, 5 ≤ m ≤ 100, 2 ≤ n ≤ 100. Consider the following sets of triples: Tm.j = {(x, y, z) ∈ IN3 |x ≤ y ≤ z ≤ m
2016-10-17 11:33:34 332
原创 UVA 6855 Banks 思维题
题目描述:On Wall Street from Wonderland, we have n banks, with 10000 > n > 0. Each bank has exactly two neighbours, the left (L) and right (R) neighbour. The first bank’s left neighbour is the last bank,
2016-10-17 10:37:57 656
原创 HDU 5092 Seam Carving DP
题目描述:Problem Description Fish likes to take photo with his friends. Several days ago, he found that some pictures of him were damaged. The trouble is that there are some seams across the pictures. So
2016-10-13 20:02:20 443
原创 数位DP!!!(hdu3555 hdu2089 hdu5898 2016弱校10.5 I)
博客描述:各种数位DP,均是用模板做的。先把模板一放!// pos = 当前处理的位置(一般从高位到低位)// pre = 上一个位的数字(更高的那一位)// status = 要达到的状态,如果为1则可以认为找到了答案,到时候用来返回,// 给计数器+1。// limit = 是否受限,也即当前处理这位能否随便取值。如567,当前
2016-10-13 11:41:48 483
原创 10.3 弱校 D Parentheses 思维题
题目描述:https://acm.bnu.edu.cn/v3/contest_show.php?cid=8504#problem/D题目分析:大意就是输入一个数n,创造一个只有’(‘和’)’的序列,并且恰好最少用n步将这个序列成为合法的括号序列(也就是每一个括号都能配对)。并且这个序列必须是越短越好,而且字典序最小(左括号字典序小于右括号字典序)。 由于各种条件限制,这个构造是唯一的。 我们可以
2016-10-03 19:48:33 273
原创 10.3 弱校 B Help the Princess! 搜索
题目描述:https://acm.bnu.edu.cn/v3/contest_show.php?cid=8504#problem/B题目分析:由于题目是pdf格式给出的 我就扔连接算了~~ 题目大意就是一个n*m的地图,其中有一个’@’表示公主,有若干个’$’表示士兵,一个’%’表示出口,’#’表示墙(无法进入),’.’表示可以走的地方。其中公主想要逃亡到出口,有士兵追击,若公主能够走到出口且没有
2016-10-03 19:23:50 349
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人