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_
程序设计竞赛:贪心算法:区间问题
有n项工作,每项工作分别在si时间开始,ti时间结束。对于每项工作你选择参与与否,如果选择了参与,那么自始至终就必须全程参与。参与工作的时间段不可以重复。(开始的瞬间和结束重复也不可以)尽可能多的参与工作,可以参与多少。/*------------------------------------[输入]n=5,s={1,2,,4,6,8},t={3,5,7,9,10}---------------
mijian1207mijian
·
2016-04-12 01:00
ACM_
程序设计竞赛:贪心算法:硬币问题
贪心算法:就是贪心的选取当前最优策略的算法设计方法。有1元,5元,10元,50元,100元,500元的硬币,各C1,C5,C10,C50,C100,C500枚。现在要用来支付A元,最少需要各种硬币多少。/*[输入]c1=3,c5=2,c10=1,c50=3,c100=0,c500=2,A=620[输出]6(500的1个,50的2个,10的1个,5元的2个,合计6个)[算法]1.优先使用大面值*/
mijian1207mijian
·
2016-04-05 01:00
ACM_
程序设计竞赛:穷举法:BFS(广度优先)
类似于层次遍历首先访问起始顶点v,v出发,依次访问领接的顶点w1,w2,...,wi不后退,一步可以访问一批结点//结果:abcdefgh//算法: boolvisited[MAX_VERTEX_NUM];//访问标记数组 voidBFSTraverse(GraphG){ //图G进行广度优先遍历,设访问函数visit() for(i=0;i=0;w=NextNeighbor(G,v,w))//检
mijian1207mijian
·
2016-04-01 01:00
[poj 1019] Number Sequence 数学
想法题
NumberSequenceTimeLimit:1000MSMemoryLimit:10000KTotalSubmissions:37345Accepted:10777DescriptionAsinglepositiveintegeriisgiven.Writeaprogramtofindthedigitlocatedinthepositioniinthesequenceofnumbergroup
ALPS233
·
2016-03-31 10:00
数学
poj
ACM_
程序设计竞赛:穷举法:DFS(深度优先)
DFS的伪码从顶点v出发;访问v相邻且未被访问的顶点w1依次w2,....,,直到不能继续退回到出发点v,若v的领域还有为访问结点,重复上述//结果:abdceghfboolvisited[MAX_VERTEX_NUM];//访问数组标记 voidDFSTraverse(GraphG) { //对图G深度遍历,访问函数是visit() for(v=0;v=0;w=NextNeighor(G,v,w
mijian1207mijian
·
2016-03-30 01:00
【bzoj 3192】: [JLOI2013]删除物品 树状数组+
想法题
3192:[JLOI2013]删除物品TimeLimit:10SecMemoryLimit:128MBSubmit:707Solved:416[Submit][Status][Discuss]Description箱子再分配问题需要解决如下问题:(1)一共有N个物品,堆成M堆。(2)所有物品都是一样的,但是它们有不同的优先级。(3)你只能够移动某堆中位于顶端的物品。(4)你可以把任意一堆中位于顶端
ALPS233
·
2016-03-18 21:26
树状数组
想法题
BZOJ
刷题记录
【bzoj 3192】: [JLOI2013]删除物品 树状数组+
想法题
3192:[JLOI2013]删除物品TimeLimit:10SecMemoryLimit:128MBSubmit:707Solved:416[Submit][Status][Discuss]Description箱子再分配问题需要解决如下问题:(1)一共有N个物品,堆成M堆。(2)所有物品都是一样的,但是它们有不同的优先级。(3)你只能够移动某堆中位于顶端的物品。(4)你可以把任意一堆中位于顶端
ALPS233
·
2016-03-18 21:00
【bzoj 3192】: [JLOI2013]删除物品 树状数组+
想法题
3192:[JLOI2013]删除物品TimeLimit:10SecMemoryLimit:128MBSubmit:707Solved:416[Submit][Status][Discuss]Description箱子再分配问题需要解决如下问题:(1)一共有N个物品,堆成M堆。(2)所有物品都是一样的,但是它们有不同的优先级。(3)你只能够移动某堆中位于顶端的物品。(4)你可以把任意一堆中位于顶端
ALPS233
·
2016-03-18 21:00
南阳理工
ACM_
题目23
描述一天,TT在寝室闲着无聊,和同寝的人玩起了取石子游戏,而由于条件有限,他/她们是用旺仔小馒头当作石子。游戏的规则是这样的。设有一堆石子,数量为N(102.usingnamespacestd;03.intmain()04.{05.intk;06.longm,n;07.cin>>k;08.while(k--)09.{10.cin>>n>>m;11.if(n%(m+1)==0)12.cout<<"L
不闹的疯子
·
2016-03-17 17:40
ACM练习题
HDU 5632 Rikka with Array [
想法题
]
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5632------------------------------------------------------------------------------------------这场比赛的官方题解说这题比较明显,然而我比赛完后对着题解看了好久也没有想明白于是先做了几道数位$DP$找找感觉可惜感觉
sagitta
·
2016-02-28 23:00
ACM_
模板_求质因子
求一个数的质因子用到的方法就是有策略的暴力,没求出一个质因子,就让原数消除这一个因数。//求一个数的质因子 #include intmain() { __int64a[100],num,i,n; while(scanf("%I64d",&n)!=EOF) { num=0; for(i=2;i*i1) a[num++]=n; for(i=0;i
RaAlGhul
·
2016-02-26 21:00
ACM_
模板_进制转换
有关于进制转换的问题,关键就是用C语言去模拟短除法的过程。#include//进制转换 intmain() { intN,R,k,a[20],i; while(scanf("%d%d",&N,&R)!=EOF) { k=0; if(N=10) printf("%c",'A'+a[i-1]-10); else printf("%d",a[i-1]); i--; } printf("\n"); } r
RaAlGhul
·
2016-02-26 20:00
ACM_
模板_最小公倍数
gcd函数的书写方式有很多种,很多人都是用循环的,而小编的模板用则是用函数的递归,从代码上很简介,且非常易于理解。#include//最小公倍数 intgcd(inta,intb) { if(a
RaAlGhul
·
2016-02-26 20:00
ACM_
模板_网络流
第一次接触网络流,感觉像是一堆的算法扑面而来,三天就要过去了,才刚刚对几个算法有了点初步的理解,感觉上离要熟练的做出题还很遥远,这里先给出小编对几个算法的模板总结。1.Edmond-Karp算法这种算法是最好理解的,网络上也有很多的对此算法的讲解,这里小编就不给出详细的讲解。算法的关键就是不停的在残留网络中找到增广路径,并不停的修改残留网络中的值,最后知道找不到增广路径为止,得到最大流。#incl
RaAlGhul
·
2016-02-25 22:00
CF507C 给定一种二叉树的走法,问到第n个叶子结点之前,有多少个结点被走过
这题属于没
想法题
。
cacyth
·
2016-02-21 22:00
LightOJ 1342 Aladdin and the Magical Sticks [
想法题
]
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=27050------------------------------------------------------------------------------------------------------------我们先考虑这个问题有一堆牌其中$n$张牌抽到
sagitta
·
2016-02-11 00:00
几个向量(可轮转)的映射是否相同(
想法题
)
http://codeforces.com/problemset/gymProblem/100203/D哈希。。。Forexample,(1,2,2,3)≡(22,3,4,22),可以轮转成(4,22,22,3),前面的1对应4,2对应22,3对应3,所以存在一个映射。通过观察发现两个向量里的相同数字距离是一致的。#include usingnamespacestd; typedeflonglon
cacyth
·
2016-01-22 21:00
FOJ 11月月赛题解
FZU2205这是个
想法题
,每次可以在上一次基础上加上边数/2的新边。
夢中花落
·
2015-11-25 00:00
nyoj--1087--摆方格(规律)
样例输入123样例输出1619上传者
ACM_
刘
qq_29963431
·
2015-11-13 20:00
UVALive - 6039
想法题
,只需要分析一个点及其直接连通的边即可,维护一个vtot记录总和,vmax记录最大的边权,如果vmax>=vtot-2,那么一共有vmax个自行车。
·
2015-11-13 20:48
live
CodeForces 111B - Petya and Divisors 统计..
想法题
找每个数的约数(暴力就够了...1~x^0.5)....看这约数的倍数最后是哪个数...若距离大于了y..统计++...然后将这个约数的最后倍数赋值为当前位置...好叼的
想法题
·
2015-11-12 12:08
codeforces
SGU 410 Galaxy in danger --贪心,
想法题
题意:有n个星球,每个星球有Ai个人,每次有两种选择,第一是从每个星球上去掉1个人,第二个选择是选择一个星球放置一个科学家,将该星球的人数加倍,问最少多少次能够将所有星球上的人数同时变为0,并且如果步数<=1000,还要输出操作顺序。 解法:找出人数最多的那个星球,设最大人数为maxi,那么跑一个循环,每次该星球如果人数<maxi,那么能加倍就加倍到离maxi最近的位置,然后计算他们
·
2015-11-12 10:25
in
Count PAT's (25)
想法题
吧,算是排列组合吧
1093. Count PAT's (25) 时间限制 120 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CAO, Peng The string APPAPT contains two PAT's as substrings. The first one is formed by the 2
·
2015-11-11 18:04
count
2013ACM多校联合(2)_HUT 解题报告
训练赛 RankList 解题报告转摘自 Lyush A.简单的
想法题
。
·
2015-11-11 17:32
ACM
ACM_
高次同余方程
/*poj3243 *解决高次同余方程的应用,已知X^Y=KmodZ,及X,Z,K的值,求Y的值 */ #include #include #include usingnamespacestd; #definelint__int64 #defineMAXN131071 structHashNode{lintdata,id,next;}; HashNodehash[MAXN=1) { if(b&1
xiaotan1314
·
2015-11-07 10:00
高次同余方程
ACM_
扩展欧几里德算法
/* 扩展欧几里德算法 基本算法:对于不完全为0的非负整数a,b,gcd(a,b)表示a,b的最大公约数,必然存在整数对x,y,使得gcd(a,b)=ax+by。 证明:设a>b。 1,显然当b=0,gcd(a,b)=a。此时x=1,y=0; 2,ab!=0时 设ax1+by1=gcd(a,b); bx2+(amodb)y2=gcd(b,amodb); 根据朴素的欧几里德原理有gcd
xiaotan1314
·
2015-11-06 14:00
算法
ACM
gcd
Hiring Staff
想法题
目
http://codeforces.com/problemset/problem/216/C 题意: 在Berland法律规定每个工人的工作是这样的:它必须连续工作n天,然后休息m天,然后才能继续工作n天休息m天也即他的工作时间为[x, x + 1, ..., x + n - 1], [x + m + n, x + m + n + 1, ..., x + m + 2n - 1]&nb
·
2015-11-02 15:02
codeforces
[
ACM_
模拟] UVA 12504 Updating a Dictionary [字符串处理 字典增加、减少、改变问题]
Updating a Dictionary In this problem, a dictionary is collection of key-value pairs, where keys are lower-case letters, and values are non-negative integers. Given
·
2015-11-01 10:30
字符串处理
[
ACM_
水题] UVA 12502 Three Families [2人干3人的活后分钱,水]
Three Families Three families share a garden. They usually clean the garden together at the end of each week, but last week, family C was on holiday, so family A sp
·
2015-11-01 10:29
ACM
[
ACM_
模拟] UVA 12503 Robot Instructions [指令控制坐标轴上机器人移动 水]
Robot Instructions You have a robot standing on the origin of x axis. The robot will be given some instructions. Your task is to predict its position after executin
·
2015-11-01 10:29
struct
BZOJ3563 : DZY Loves Chinese
想法题
,由于K是加密的,但是通过读入我们可以自己数出来这一行有几个数, 所以可以直接反解出之前回答为连通的个数 至于最后一个询问就用并查集暴力回答 var n,i,m,s,
·
2015-10-31 16:42
chinese
[
ACM_
数据结构] POJ2352 [树状数组稍微变形]
Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars tha
·
2015-10-31 11:37
数据结构
[
ACM_
图论] ZOJ 3708 [Density of Power Network 线路密度,a->b=b->a去重]
The vast power system is the most complicated man-made system and the greatest engineering innovation in the 20th century. The following diagram shows a typical 14 bus power system. In
·
2015-10-31 11:36
NetWork
[
ACM_
水题] ZOJ 3712 [Hard to Play 300 100 50 最大最小]
MightyHorse is playing a music game called osu!. After playing for several months, MightyHorse discovered the way of calculating score in osu!: 1. While p
·
2015-10-31 11:36
play
[
ACM_
暴力][
ACM_
几何] ZOJ 1426 Counting Rectangles (水平竖直线段组成的矩形个数,暴力)
Description We are given a figure consisting of only horizontal and vertical line segments. Our goal is to count the number of all different rectangles formed by these segments. As an example, the n
·
2015-10-31 11:36
count
[
ACM_
动态规划] UVA 12511 Virus [最长公共递增子序列 LCIS 动态规划]
Virus We have a log file, which is a sequence of recorded events. Naturally, the timestamps are strictly increasing. However, it is infected by a virus, so random
·
2015-10-31 11:36
动态规划
[
ACM_
动态规划] hdu 1176 免费馅饼 [变形数塔问题]
Problem Description 都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老
·
2015-10-31 11:36
动态规划
[
ACM_
模拟] ACM - Draw Something Cheat [n个长12的大写字母串,找出交集,按字母序输出]
Description Have you played Draw Something? It's currently one of the hottest social drawing games on Apple iOS and Android Devices! In this game, you and your friend play in turn. You
·
2015-10-31 11:36
ACM
[
ACM_
数学] LA 3708 Graveyard [墓地雕塑 圈上新加点 找规律]
Description Programming contests became so popular in the year 2397 that the governor of New Earck -- the largest human-inhabited planet of the galaxy -- opened a special Alley of
·
2015-10-31 11:36
ACM
[
ACM_
水题] UVA 11292 Dragon of Loowater [勇士斗恶龙 双数组排序 贪心]
Once upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem. The shores of Rellau Creek in central Loowater had always been a prime breeding ground for g
·
2015-10-31 11:36
water
[
ACM_
模拟][
ACM_
数学] LA 2995 Image Is Everything [由6个视图计算立方体最大体积]
Description Your new company is building a robot that can hold small lightweight objects. The robot will have the intelligence to determine if an object is light enough to hold. It
·
2015-10-31 11:36
image
[
ACM_
图论] The Perfect Stall 完美的牛栏(匈牙利算法、最大二分匹配)
描述 农夫约翰上个星期刚刚建好了他的新牛棚,他使用了最新的挤奶技术。不幸的是,由于工程问题,每个牛栏都不一样。第一个星期,农夫约翰随便地让奶牛们进入牛栏,但是问题很快地显露出来:每头奶牛都只愿意在她们喜欢的那些牛栏中产奶。上个星期,农夫约翰刚刚收集到了奶牛们的爱好的信息(每头奶牛喜欢在哪些牛栏产奶)。一个牛栏只能容纳一头奶牛,当然,一头奶牛只能在一个牛栏中产奶。 给出奶牛们的爱好的信息,计算最
·
2015-10-31 11:35
ACM
[
ACM_
搜索] ZOJ 1103 || POJ 2415 Hike on a Graph (带条件移动3盘子到同一位置的最少步数 广搜)
Description "Hike on a Graph" is a game that is played on a board on which an undirected graph is drawn. The graph is complete and has all loops, i.e. for any two locations there is exactly
·
2015-10-31 11:35
Graph
[
ACM_
图论] Fire Net (ZOJ 1002 带障碍棋盘布炮,互不攻击最大数量)
Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall. A blockhouse is a small cas
·
2015-10-31 11:35
ACM
[
ACM_
图论] Sorting Slides(挑选幻灯片,二分匹配,中等)
Description Professor Clumsey is going to give an important talk this afternoon. Unfortunately, he is not a very tidy person and has put all his transparencies on one big heap. Before giving the talk
·
2015-10-31 11:35
sort
[
ACM_
搜索] Triangles(POJ1471,简单搜索,注意细节)
Description It is always very nice to have little brothers or sisters. You can tease them, lock them in the bathroom or put red hot chili in their sandwiches. But there is also a time when all meanne
·
2015-10-31 11:35
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
上一页
1
2
3
4
5
6
下一页
按字母分类:
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
其他