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
Ancient
poj-2159-
Ancient
Cipher
字符串的水题,说要怎么怎么转化怎么怎么匹配,其实一眼就能看出只需要匹配字符个数就好了#include #include #include #include usingnamespacestd; intmain() { chars1[105],s2[105]; inta[26],b[26]; while(scanf("%s%s",s1,s2)!=EOF) { memset(a,0,sizeof(
Ypopstar
·
2016-03-23 22:00
模拟
codeforces-611D-New Year and
Ancient
Prophecy【lcp+dp】【好题】
611D-NewYearandAncientProphecytimelimitpertest2.5secondsmemorylimitpertest512megabytes Limakisalittlepolarbear.Inthesnowhefoundascrollwiththeancientprophecy.Limakdoesn’tknowanyancientlanguagesandthusi
loy_184548
·
2016-03-12 15:00
dp
codeforces
lcp
611D
UVALive 3213
Ancient
Cipher(坑呀.........)
.AncientCipherTimeLimit: 3000MS MemoryLimit: Unknown 64bitIOFormat: %lld&%lluSubmit StatusDescription题意:给;两个长度相同的字符串,判断他们之间的26个字母是否一一对应,即做一个一映射后是的两个字符串相同.例如:ABB与CDD可以,方法是A->C,B->D,B->D,但ABC与DED不能一一对应.
hurmishine
·
2016-03-10 21:00
Ancient
Berland Circus 计算几何
C.AncientBerlandCircus题目连接:http://www.codeforces.com/contest/1/problem/CDescriptionNowadaysallcircusesinBerlandhavearoundarenawithdiameter13meters,butinthepastthingsweredifferent.InAncientBerlandarena
qscqesze
·
2016-03-10 17:00
Codeforces 611D New Year and
Ancient
Prophecy DP
题意:把一个字符串分割成多个小串,小串组成严格递增序列,n=s[j....i],dp[i][j]+=dp[j-1][k-1]这样dp的递推式就有了,很容易发现dp[i][j]的递推式是一个前缀和,假设我比较s[k-1....j-1]和s[j....i]是O(1)那么就可以在n^2的复杂度里得到答案所以问题转化为如何预处理以x为开头的串和以y为开头的串的大小(x0)r[x][y]=r[x-1][y-
imwutianqi
·
2016-03-09 10:00
New Year and
Ancient
Prophecy
D.NewYearandAncientProphecytimelimitpertest2.5secondsmemorylimitpertest512megabytesinputstandardinputoutputstandardoutputLimakisalittlepolarbear.Inthesnowhefoundascrollwiththeancientprophecy.Limakdoes
acm_fighting
·
2016-03-08 08:00
Ancient
Cipher(UVA1339)
感觉这道水题很有意思,起先心想这怎么做,既能随意重排,又能有随意的映射。后来一想,不可能这么这么复杂,一定是有地方我没有想到。果然啊,自我回想了一下,这种一点思路没有的题目我个人感觉最好的办法去尝试题中例子,一个一个带入,看看为什么可以,慢慢就会找到问题的本质。比如输入AABBCC SSDDCC,很明显,这是可以的。输入ABCABC,SDCSDC。和上一个输入一样,那肯定也是YES。一般我们总是
u011613367
·
2016-03-04 20:00
ACM
水题
uva
hdu 3460
Ancient
Printer 解题报告
AncientPrinterTimeLimit:2000/1000MS(Java/Others) MemoryLimit:131072/65536K(Java/Others)TotalSubmission(s):1705 AcceptedSubmission(s):828ProblemDescriptionThecontestisbeginning!Whilepreparingthec
qq_21899803
·
2016-03-04 18:00
Printer
字典树
Ancient
New Year and
Ancient
Prophecy(dp)
Description给出一个长度为n的数字串,要求将这个数字串拆成一些无前置零的子串,使得这些子串所表示的数字是严格递增的,问有多少种拆分方法Input第一行为一整数n表示数字串长度,之后为一数字串(1 #include #include #include usingnamespacestd; #definemaxn5555 #definemod1000000007ll typedeflongl
V5ZSQ
·
2016-02-27 20:00
例题6-13 UVA 1103
Ancient
Messages 古老象形符号
简单说下题意:给你一个H行W列的字符矩阵,他们是压缩后的十六进制矩阵,把每一个字符变成四个二进制数后,1代表黑像素,0代表白像素,问这些像素组成的图案是题目6种的哪一种!题意有几个需要注意的地方:书中分析说数白洞个数!但有可能多个图案放在一起,如何分开呢,那就是上下左右不相互有公共边,斜着就不算了!思路:1.把他们存到int二维数组里面,1写成-1,0还是0,然后先第一遍dfs,把所有黑色图案编号
aozil_yang
·
2016-02-20 12:00
C语言
uva
水题 UVA 1586 -
Ancient
Cipher化学式分子量计算
原题见:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=106424#overview题目要求,根据所给化学量与原子量计算化学式的相对分子质量。。。其实就是怎么对应起来的事。 代码如下:1#include 2//给出一种物质的分子式(不带括号),求分子量。 3//本题中的分子式只包含4种原子:C,H,O,N,原子量分别为12.01
么么哒小鬼
·
2016-02-15 21:00
hdu3460
Ancient
Printer
AncientPrinterTimeLimit:2000/1000MS(Java/Others) MemoryLimit:131072/65536K(Java/Others)ProblemDescriptionThecontestisbeginning!Whilepreparingthecontest,iSeawantedtoprinttheteams'namesseparatelyonas
acm_fighting
·
2016-02-15 10:00
【UVA 1586】
Ancient
Cipher
题题意给你一个只含CHON的有机物的化学式如C6H5OH求相对分子质量分析。。。代码#include #include #include #definelllonglong usingnamespacestd; llt; doublew,m[5]={12.01,1.008,16.00,14.01}; chars[100]; voidadd(intf,inti) { if(i
水郁
·
2016-02-13 23:00
集训队专题(1)1005
Ancient
Printer
AncientPrinterTimeLimit:2000/1000ms(Java/Other) MemoryLimit:131072/65536K(Java/Other)TotalSubmission(s):25 AcceptedSubmission(s):14ProblemDescriptionThecontestisbeginning!Whilepreparingthecontest,
RaAlGhul
·
2016-01-27 14:00
Good Bye 2015 D - New Year and
Ancient
Prophecy
题意:给你一个数字组成的字符串,把它分成几个子串,使得每个串组成的数,没有前导0,且位置在前的字符串组成的数要严格小于位置在后的字符串,问你有多少种不同的分法。思路:LCP+dp转移方程:dp[i][j]+=dp[i-j][k](1 2#include 3#include 4#include 5#include 6#include 7#include 8#include 9#inc
untiltetw
·
2016-01-24 21:00
Ancient
Berland Hieroglyphs 单调队列
B.AncientBerlandHieroglyphs题目连接:http://codeforces.com/problemset/problem/164/BDescriptionww.coPolycarpusenjoysstudyingBerlandhieroglyphs.OncePolycarpgotholdoftwoancientBerlandpictures,oneachofwhichwas
qscqesze
·
2016-01-21 20:00
Ancient
Berland Hieroglyphs 单调队列
B.AncientBerlandHieroglyphs题目连接:http://codeforces.com/problemset/problem/164/BDescriptionww.coPolycarpusenjoysstudyingBerlandhieroglyphs.OncePolycarpgotholdoftwoancientBerlandpictures,oneachofwhichwas
qscqesze
·
2016-01-21 20:00
uva1103
Ancient
Messages
这题剥去洋洋洒洒的体面,就是求连通块个数,和连通块里空白区域的个数,最后判断是哪个象形字,好有创意。题意:给你象形字的图形,给你一个01矩阵,拓扑等价画出这些象形字,判断图中有哪些象形字。思路:观察可以发现,每个象形字的空白块数是不同的,因此用dfs求出每个象形区域的联通块数就可以判断是那个字,按照字典序输出。 最初,我在想怎么找到恰好每个字的范围才能找它里面有多少空白区域。所以这里有两个dfs,
yexiaohhjk
·
2016-01-16 13:00
New Year and
Ancient
Prophecy
timelimitpertest2.5secondsmemorylimitpertest512megabytesinputstandardinputoutputstandardoutputLimakisalittlepolarbear.Inthesnowhefoundascrollwiththeancientprophecy.Limakdoesn'tknowanyancientlanguagesa
Kirito_Acmer
·
2016-01-01 22:00
dp
codeforces
lcp+dp Codeforces611D New Year and
Ancient
Prophecy
传送门:点击打开链接题意:长为n的只有数字组成的字符串(n=len,说明两个区间的数字是完全相等的,此时肯定数字是相等的如果lcp[a][b]=1且以j-len开头比以j开头且长度为len数字要小边界条件是j=1,此时应该等于1感觉还有地方,,就是写dp的时候总是处理不好边界条件其实感觉如果就在第二层for里面写if判断边界,这是一种非常好的方法,减少了很多思考,。#include #includ
qwb492859377
·
2016-01-01 17:00
【codechef】
Ancient
Berland Roads(线段树)
题目描述在古老的宝兰国有N座城市和M条双向道路。随着时间的流逝,一些道路渐渐变得破旧,最后因为损坏而无法使用,而从来没有人维修这些道路。作为古宝兰国历史的热爱者,你想要做一个小小的研究。为此,你想要写一个程序来处理以下的操作:•DK,代表输入中的第K条道路损坏了。道路从1开始编号;•PAB,代表编号为A的城市的人口数变为了B。我们称一些城市构成的集合为一个区域,当且仅当对于集合中的任意两座城市,都
cacyth
·
2015-12-27 17:00
dfs
ancient
go
http://acm.uestc.edu.cn/#/problem/show/1221#include #include #include usingnamespacestd; intvis[15][15],cnt; intd[4][2]={1,0,-1,0,0,1,0,-1}; chars[15][15]; voiddfs(intx,inty) { if(s[x][y]=='.') { cnt+
aonaigayiximasi
·
2015-11-26 19:00
UESTC 1218
Ancient
Go (我的递归~~)
http://acm.uestc.edu.cn/#/problem/show/1221大意:围棋判定,能不能下一步棋使得对手死去至少一个棋子。对递归理解不深入导致开始不停RE(反复递归调用致使栈溢出),我去~~#include #include #include #include usingnamespacestd; charg[50][50]; intdir[4][2]={{-1,0},{1,0
theArcticOcean
·
2015-11-25 09:00
递归
CodeForces 260B
Ancient
Prophesy 模拟
给出字符串找出符合"dd-mm-yyyy"格式的2013~2015年的出现次数最多的日期。一开始写成1~len-10怒跪。。。只要每位试一下就好了。#include #include #include charstr[100005]; intmonth[]={0,31,28,31,30,31,30,31,31,30,31,30,31}; intcnt[4][16][32]; intmain(){
huanghongxun
·
2015-11-17 21:00
codeforces
Fengshui-[SZU_B40]
Description Fengshui is an
ancient
subject in Chinese tradition.
·
2015-11-13 22:19
UI
Ancient
decoration(最小环覆盖)
给你一个n个点,每个点度为k(k为偶数)的无向图,问是否能将图中的n条边染色,使得每个点都拥有两条被染色的边。也就是说,是否存在拥有原图中n条边的子图,使得每个点的度为2?仔细想想,每个点的度为2,实际上就是求原图的最小环覆盖了。 求最小环覆盖的方法就是先求出原图的有向欧拉回路(k为偶数,欧拉回路必然存在),然后问题就转化成了是否能选择欧拉回路中的n条边,使得所有点都被覆盖?这不就转化成了DAG
·
2015-11-13 16:11
ora
UVA 10313(完全背包变形)
input Output: standard output Time Limit: 2 seconds Memory Limit: 32 MB In
ancient
·
2015-11-13 12:20
uva
双向DFS模板题
megabytes input standard input output standard output Paladin Manao caught the trail of the
ancient
·
2015-11-13 09:55
DFS
POJ2159-
Ancient
Cipher
转载请注明出处:優YoU http://user.qzone.qq.com/289065406/blog/1299062729 PS:本题稍微说一下题意(当时有点发牢骚的感觉,O(∩_∩)O哈哈~) 一种我认为是比较符合现实的解题思路,但是总是Wrong Answer 咋看之下确实是被题目忽悠了,一般思路都是先对置换解密,再对乱序解密,但是题目所给出的
·
2015-11-13 09:23
poj
Berserk Rook
Berserk Rook As you may know, chess is an
ancient
game for which almost everyone has at least
·
2015-11-13 05:38
OO
HDU 3698 Let the light guide us(DP+线段树)(2010 Asia Fuzhou Regional Contest)
Description Plain of despair was once an
ancient
battlefield where those brave spirits had rested in
·
2015-11-13 02:24
test
UVa 1339
Ancient
Cipher
Ancient
Cipher
Ancient
Roman empire had a strong government system with various departments, including
·
2015-11-13 01:26
uva
POJ 2208 Pyramids(求四面体体积)
Log Archeo has discovered
ancient
pyramids.
·
2015-11-13 00:10
poj
HDU 1693 Eat the Trees(插头DP,入门题)
Problem Description Most of us know that in the game called DotA(Defense of the
Ancient
), Pudge is
·
2015-11-13 00:51
tree
POJ 3384 Feng Shui(计算几何の半平面交+最远点对)
Description Feng shui is the
ancient
Chinese practice of placement and arrangement of space to achieve
·
2015-11-13 00:09
poj
Book of Evil 树双向DFS
Book of Evil Paladin Manao caught the trail of the
ancient
Book of Evil in a swampy area
·
2015-11-12 23:34
DFS
[POJ 1151] Atlantis
10000K Total Submissions: 18148 Accepted: 6902 Description There are several
ancient
·
2015-11-12 12:13
ant
ACM学习历程—POJ1151 Atlantis(扫描线 && 线段树)
Description There are several
ancient
Greek texts that contain descriptions of the fabled island Atlantis
·
2015-11-12 11:19
ant
ACM学习历程——HDU4472 Count(数学递推) (12年长春区域赛)
Tigris is the head of an archaeological team who is currently in charge of an excavation in a site of
ancient
·
2015-11-12 11:57
count
UVA1339 -
Ancient
Cipher
Ancient
Roman empire had a strong government system with various departments, including a secret service
·
2015-11-12 11:28
uva
杭电1010(dfs + 奇偶剪枝)
题目: The doggie found a bone in an
ancient
maze, which fascinated him a lot.
·
2015-11-12 10:43
DFS
HDU 1134 卡特兰数 大数乘法除法
Problem Description This is a small but
ancient
game.
·
2015-11-12 10:31
HDU
【POJ1151】【扫描线+线段树】Atlantis
Description There are several
ancient
Greek texts that contain descriptions of the fabled island Atlantis
·
2015-11-11 19:15
ant
uva--1339 -
Ancient
Cipher(模拟水体系列)
&n
·
2015-11-11 19:44
uva
Ancient
Berland Circus(几何)
Ancient
Berland Circus time limit per test 2 seconds memory limit per test 64 megabytes input
·
2015-11-11 19:03
round
zoj 2110 Tempter of the Bone
Time Limit: 1 Second Memory Limit: 32768 KB The doggie found a bone in an
ancient
·
2015-11-11 13:07
one
UVa1399.
Ancient
Cipher
option=com_onlinejudge&Itemid=8&page=show_problem&problem=4085 13855995 1339
Ancient
·
2015-11-11 12:41
uva
SGU 286
Ancient
decoration(二分图解决欧拉回路)
题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=286 题意:给定一个无向图,每个点的度数均为偶数。在这个图中选择一些边使得每个点恰好都被覆盖两次。 思路:找到的边其实可以组成一个或者多个欧拉回路。那么此题就是求欧拉回路。由于每个点的度数为偶数,所以欧拉回路一定存在。问题在于首先要将无向图转化为有向图,因为若(u,v),则匹配时
·
2015-11-11 03:49
ora
hdu 5206 Four Inages Strategy 计算几何
题目链接:HDU - 5206 Young F found a secret record which inherited from
ancient
times in ancestral home by
·
2015-11-11 03:41
strategy
codeforces 337D Book of Evil(dp)
nbsp; ——by fraud Book of Evil Paladin Manao caught the trail of the
ancient
·
2015-11-11 02:18
codeforces
上一页
1
2
3
4
5
6
7
8
下一页
按字母分类:
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
其他