E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
ACM_枚举法
[
ACM_
动态规划] ZOJ 1425 Crossed Matchings(交叉最大匹配 动态规划)
Description There are two rows of positive integer numbers. We can draw one line segment between any two equal numbers, with values r, if one of them is located in the first row and the other one is
·
2015-10-31 11:35
match
[
ACM_
搜索] POJ 1096 Space Station Shielding (搜索 + 洪泛算法Flood_Fill)
Description Roger Wilco is in charge of the design of a low orbiting space station for the planet Mars. To simplify construction, the station is made up of a series of Airtight Cubical Modules (ACM's
·
2015-10-31 11:35
ACM
[
ACM_
几何] Transmitters (zoj 1041 ,可旋转半圆内的最多点)
Description In a wireless network with multiple transmitters sending on the same frequencies, it is often a requirement that signals don't overlap, or at least that they don't conflict. One way of a
·
2015-10-31 11:35
ACM
[
ACM_
模拟] The Willy Memorial Program (poj 1073 ,联通水管注水模拟)
Description Willy the spider used to live in the chemistry laboratory of Dr. Petro. He used to wander about the lab pipes and sometimes inside empty ones. One night while he was in a pipe, he fell as
·
2015-10-31 11:35
ACM
[
ACM_
其他] Square Ice (poj1099 规律)
Description Square Ice is a two-dimensional arrangement of water molecules H2O, with oxygen at the vertices of a square lattice and one hydrogen atom between each pair of adjacent oxygen atoms. The
·
2015-10-31 11:35
ACM
[
ACM_
图论] Highways (变形说法的最小生成树)
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28972#problem/C 题目给出T种情况,每种情况有n个城镇,接下来每一行是第i个城镇到所有城镇的距离(其实就是个可达矩阵)。 求建设一条公路联通所有城镇并且要求最长的一段最小(其实就是最小生成树)!代码如下: #include<
·
2015-10-31 11:34
最小生成树
[
ACM_
数学] Counting Solutions to an Integral Equation (x+2y+2z=n 组合种类)
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=27938#problem/E 题目大意:Given, n, count the number of solutions to the equation x+2y+2z=n, where x,y,z,n are non negative inte
·
2015-10-31 11:34
count
[
ACM_
几何] The Deadly Olympic Returns!!! (空间相对运动之最短距离)
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28235#problem/B 题目大意: 有两个同时再空间中匀速运动的导弹,告诉一个时间以及各自的初始坐标和该时间时的坐标,求运动过程中的最短距离 解题思路: 求出相对初位置、相对速度,则答案就是原点到射线型轨迹的距离,注意是射线!!!
·
2015-10-31 11:34
return
[
ACM_
几何] F. 3D Triangles (三维三角行相交)
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28235#problem/A 题目大意:给出三维空间两个三角形三个顶点,判断二者是否有公共点,三角形顶点、边、内部算三角形的一部分。 解题思路:见模板 //**********************************************
·
2015-10-31 11:34
ACM
[
ACM_
动态规划] 轮廓线动态规划——铺放骨牌(状态压缩1)
Description Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series' (where he had to use his toilet paper to draw on
·
2015-10-31 11:34
动态规划
[
ACM_
图论] 棋盘问题 (棋盘上放棋子的方案数)
不能同行同列,给定形状和大小的棋盘,求摆放k个棋子的可行方案 Input 2表示是2X2的棋盘,1表示k,#表示可放,点不可放(-1 -1 结束) Output 输出摆放的方案数目C Sample Input 2 1 #. .# 4 4 ...# ..#. .#.. #... -1 -1 Sample Output 2 1
·
2015-10-31 11:34
ACM
[
ACM_
其他] 总和不小于S的连续子序列的长度的最小值——尺缩法
Description: 给定长度为n的整数数列,A[0],A[1],A[2]….A[n-1]以及整数S,求出总和不小于S的连续子序列的长度的最小值。如果解不存在,则输出0。 Input: 输入数据有多组,每组数据第一行输入n,S, (10<n<10^5,S<10^8)第二行输入A[0],A[1],A[2]….A[n-1] ( 0<A[i]≤10000)
·
2015-10-31 11:34
ACM
[
ACM_
几何] Metal Cutting(POJ1514)半平面割与全排暴力切割方案
Description In order to build a ship to travel to Eindhoven, The Netherlands, various sheet metal parts have to be cut from rectangular pieces of sheet metal. Each part is a convex polygon with at mo
·
2015-10-31 11:34
meta
[
ACM_
动态规划] Palindrome
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28415#problem/D 题目大意:给一个长为n的字符串,问最少插入几个字符成回文串 解题思路:总长-最长公共(原来的和其倒过来的串)子序列(LCS) 知识详解——LCS:给出两个子序列A,B,求长度最大的公共子序列(如152687和2356984——
·
2015-10-31 11:33
动态规划
[
ACM_
动态规划] Alignment (将军排队)
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28415#problem/F 题目大意:有n个士兵排成一列,将军想从中抽出最少人数使队伍中任何士兵都能够看到左边最远处或右边最远处 解题思路:①此题是最长上升子序列的升级版。 &
·
2015-10-31 11:33
动态规划
[
ACM_
贪心] Radar Installation
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28415#problem/A 题目大意:X轴为海岸线可放雷达监测目标点,告诉n个目标点和雷达监测半径,求最少多少个雷达可全覆盖,如果不能输出-1; 解题思路:赤裸裸的区间选点问题(数轴上有n个闭区间,去尽量少的点,使每个区间至少有一个点)。核心思想就是贪心算法:把所有区间按照b从小
·
2015-10-31 11:33
Install
[
ACM_
几何] Pipe
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28417#problem/B 本题大意: 给定一个管道上边界的拐点,管道宽为1,求一束光最远能照到的地方的X坐标,如果能照到终点,则输出...  
·
2015-10-31 11:33
ACM
[
ACM_
几何] Wall
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28417#problem/E 题目大意:依次给n个点围成的一个城堡,在周围建围墙,要求围墙离城墙的距离大于一定的值,求围墙最短长度(结果四舍五入 解题思路:求围住所有点的凸包周长+一个圆的周长 #include<iostream> #include<cma
·
2015-10-31 11:33
ACM
pku1029--false coin
枚举法
代码如下: #include<stdio.h> #include<string.h> int left[102][502]; int right[102
·
2015-10-31 09:58
pku
Nanami's Digital Board
矩形内所有的点均为1) 定义四个数组lft[][],rht[][],up[][],down[][] 在up[x][y]中存的是 点(x,y)的上边有多少个连续的1 其他同理; 在确定最大的矩形时,用到了
枚举法
·
2015-10-30 20:29
git
[
ACM_
动态规划] 找零种类
问题描述:假设某国的硬币的面值有 1、5、10、50 元四种,输入一个金额 N (正整数,N<=1000),印出符合该金额的硬币组合有多少种。 问题分析: 1、5、10 元组合出 N 元的方法数 = 以 1、5 元组合出 N 元的方法数 + 以 1、5、10 元组合出 N - 10 元的方法数(其他类推) #include<iostream> #in
·
2015-10-30 18:08
动态规划
[
ACM_
几何] Fishnet
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28417#problem/C 本题大意:有一个1X1的矩形,每边按照从小到大的顺序给n个点如图,然后对应连线将举行划分,求最大面积。 解题思路:暴力算出各点,求出各面积 #include<iostream> #incl
·
2015-10-30 18:08
ACM
[
ACM_
动态规划] 嵌套矩形
问题描述: 有n个矩阵,每个矩阵可以用两个整数a,b来表示 ,表示他的长和宽,矩阵X (a,b) 可以 嵌套 到Y (c,d) 里面当且仅当 a < c && b < d || a < d && b < c . 选出最多这种矩阵。先输出最多的数量,在输出最小字典序路径。 问题分析:本题是DAG(有向无
·
2015-10-30 18:08
动态规划
[
ACM_
动态规划] 最长上升子序列(LIS)
问题描述:给n个数,找出最长子序列并输出 问题分析: 本题是DAG(有向无环图)最长路问题,设d[i]为以i结尾的最长链的长度,则状态转移方程为:d[i]=max{0,d[j]|j<i && A[j]<A[i]}+1 ; solve one: 这里用map[i][j]存储第i个和第j个的关系0-1邻接矩阵;套用标准解DAG的模板,利用dfs求解
·
2015-10-30 18:08
动态规划
[
ACM_
动态规划] 数字三角形(数塔)
递归方法解决数塔问题 状态转移方程: d[i][j]=a[i][j]+max{d[i+1][j],d[i+1][j+1]} 注意:1\d[i][j]表示从i,j出发的最大总和; 2\变界值设为0;3\递归变界为n; 4\结果为d[1][1] #include<iostream> #include<algorithm> using namespace
·
2015-10-30 18:07
动态规划
[
ACM_
动态规划] 数字三角形(数塔)_递推_记忆化搜索
1、直接用递归函数计算状态转移方程,效率十分低下,可以考虑用递推方法,其实就是 “正着推导,逆着计算” #include<iostream> #include<algorithm> using namespace std; #define maxn 1000+5 int n; int a[maxn][maxn]; int d[maxn][maxn];
·
2015-10-30 18:07
动态规划
三种算法求解一个数组的子数组最大和
方法一:暴力
枚举法
此种方法最简单,我想应该也是每个人拿到题目想到的第一种解法了,学过一点编程的人都应该能编出此类程序。 记sum[i..j]为数组中第i个元素
·
2015-10-30 17:02
算法
状态空间搜索-
一般的状态空间搜索方法有枚举、深度/广度优先搜索、启发式搜索等等,由于
枚举法
相对比较易懂,这里不再加以介绍;同时介于篇幅的限制,我们
·
2015-10-30 11:47
搜索
卡特兰数 Catalan数 ( ACM 数论 组合 )
组合 ) Posted on 2010-08-07 21:51 MiYu 阅读(13170) 评论(1) 编辑 收藏 引用 所属分类: ACM ( 数论 ) 、
ACM
·
2015-10-28 08:51
ACM
[
ACM_
数据结构] Color the ball [线段树水题][数组开大]
Description N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次颜色吗? Input 每个测试实例
·
2015-10-27 14:03
color
[
ACM_
数据结构] 线段树模板
#include<iostream> #include<cmath> using namespace std; #define maxn 200005 class Node{ public: int l,r; int add;//附加值 int sum; }node[maxn]; int getRight(int
·
2015-10-27 14:03
数据结构
[
ACM_
数据结构] HDU 1166 敌兵布阵 线段树 或 树状数组
1 #include<iostream> 2 #include<cstdio> 3 #include<memory.h> 4 using namespace std; 5 int n,C[50005]; 6 //-------------------------- 7 int lowbit(int x){ 8
·
2015-10-27 14:03
数据结构
[
ACM_
暴力] 最多交换k个数的顺序,求a[i]的最大连续和
1 /* 2 http://codeforces.com/contest/426/problem/C 3 最多交换k个数的顺序,求a[i]的最大连续和 4 爆解 5 思路:Lets backtrack interval that should contain maximal sum. 6 To improve it we can swap
·
2015-10-27 14:02
ACM
[
ACM_
模拟] HDU 1006 Tick and Tick [时钟间隔角度问题]
Problem Description The three hands of the clock are rotating every second and meeting each other many times everyday. Finally, they get bored of this and each of them would like to
·
2015-10-27 14:02
ACM
[
ACM_
模拟] UVA 10881 Piotr's Ants[蚂蚁移动 数组映射 排序技巧]
"One thing is for certain: there is no stopping them;the ants will soon be here. And I, for one, welcome ournew insect overlords." Kent Brockman Piotr likes
·
2015-10-27 14:01
ant
[
ACM_
动态规划] hdu1003 Max Sum [最大连续子串和]
Problem Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (
·
2015-10-27 14:01
动态规划
[
ACM_
其他] Modular Inverse [a关于模m的逆 模线性方程]
Description The modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is equivalent toax
·
2015-10-27 14:59
inverse
[
ACM_
水题] Yet Another Story of Rock-paper-scissors [超水 剪刀石头布]
Description Akihisa and Hideyoshi were lovers. They were sentenced to death by the FFF Inquisition. Ryou, the leader of the FFF Inquisition, promised that the winner of Rock-paper-scissors
·
2015-10-27 14:59
ACM
[
ACM_
数学] Taxi Fare [新旧出租车费差 水 分段函数]
Description Last September, Hangzhou raised the taxi fares. The original flag-down fare in Hangzhou was 10 yuan, plusing 2 yuan per kilometer after the first 3km and 3 yuan per kilometer after 10km
·
2015-10-27 14:59
ACM
[
ACM_
模拟][
ACM_
暴力] Lazier Salesgirl [暴力 懒销售睡觉]
Description Kochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the i-th customer a piece of bread for price pi. But
·
2015-10-27 14:59
ACM
[
ACM_
几何] UVA 11300 Spreading the Wealth [分金币 左右给 最终相等 方程组 中位数]
Problem A Communist regime is trying to redistribute wealth in a village. They have have decided to sit everyone around a circular table. First, everyone has converted all of their properties
·
2015-10-27 14:57
reading
[
ACM_
水题] UVA 11729 Commando War [不可同时交代任务 可同时执行 最短完成全部时间 贪心]
There is a war and it doesn't look very promising for your country. Now it's time to act. You have a commando squad at your disposal and planning an ambush on an important enemy camp located n
·
2015-10-27 14:57
command
[
ACM_
模拟] ZOJ 3713 [In 7-bit 特殊输出规则 7bits 16进制]
Very often, especially in programming contests, we treat a sequence of non-whitespace characters as a string. But sometimes, a string may contain whitespace characters or even be empty
·
2015-10-27 14:56
ACM
[
ACM_
水题] ZOJ 3706 [Break Standard Weight 砝码拆分,可称质量种类,暴力]
The balance was the first mass measuring instrument invented. In its traditional form, it consists of a pivoted horizontal lever of equal length arms, called the beam, with a
·
2015-10-27 14:55
break
[
ACM_
水题] ZOJ 3714 [Java Beans 环中连续m个数最大值]
There are N little kids sitting in a circle, each of them are carrying some java beans in their hand. Their teacher want to select M kids who seated in M
·
2015-10-27 14:55
java
[
ACM_
暴力] ZOJ 3710 [Friends 共同认识 最终认识 暴力]
Alice lives in the country where people like to make friends. The friendship is bidirectional and if any two person have no less than k friends in common, they will become fr
·
2015-10-27 14:55
ACM
[
ACM_
数学] Fibonacci Nim(另类取石子,2-4组合游戏)
游戏规则: 有一堆个数为n的石子,游戏双方轮流取石子,满足: 1)先手不能在第一次把所有的石子取完; 2)之后每次可以取的石子数介于1到对手刚取的石子数的2倍之间(包含1和对手刚取的石子数的2倍)。 约定取走最后一个石子的人为赢家,求必败态。 问题分析: 这个和之前的Wythoff’s Game 和取石子游戏 有一个很大的不同点,就是
·
2015-10-27 14:54
fibonacci
[
ACM_
模拟] ZJUT 1155 爱乐大街的门牌号 (规律 长为n的含k个逆序数的最小字典序)
Description ycc 喜欢古典音乐是一个 ZJUTACM 集训队中大家都知道的事情。为了更方便地聆听音乐,最近 ycc 特意把他的家搬到了爱乐大街(德语Philharmoniker-Straße )。在爱乐大街上,依次坐落着N座跟音乐有关的建筑,比如音乐厅、歌剧院等建筑。走在爱乐大街的路上,ycc&n
·
2015-10-27 14:53
ACM
[
ACM_
模拟] ZJUT OJ 1139 七龙珠 (追及类问题,s-t图像,模拟)
Description 话说孙悟饭与小林正在与刚造访地球的赛亚人贝吉塔交战,因为连贝吉塔的手下纳巴的实力也远在他俩之上,由于差距悬殊,小林不得不设脱离战场,去寻找正在修炼中的悟空求救,而赛亚人一伙岂能让他们轻易逃脱,于是贝吉塔让纳巴去追小林而着手对付孙悟饭。 假设小林的速度是vp 每秒,纳巴速度 vd每秒,他俩与贝吉塔当时处在同一地点
·
2015-10-27 14:53
ACM
[
ACM_
动态规划] POJ 1050 To the Max ( 动态规划 二维 最大连续和 最大子矩阵)
Description Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a rectangle
·
2015-10-27 14:52
动态规划
上一页
11
12
13
14
15
16
17
18
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他