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
Ignatius
c语言杭电1029
Ignatius
and the Princess IV
#include#include#includeusingnamespacestd;inta[999999];//要定义为全局变量才行,否则会溢出。intmain(){ intn,i,j=0; while(~scanf("%d",&n)){ for(i=0;i
qq_24678203
·
2015-03-29 16:00
HDU 1026
Ignatius
and the Princess I
ProblemDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourprettyPrincess.Nowhegetsintofeng5166'scastle.Thecastleisalargelabyrinth.Tomaketheproblemsimply,weassumet
lishuzhai
·
2015-03-15 16:00
bfs
HDU - 1098 -
Ignatius
's puzzle (数论 - 费马小定理)
Ignatius
'spuzzleTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission
u014355480
·
2015-03-13 23:00
Algorithm
Math
数论
ACM
费马小定理
HDU 1029
Ignatius
and the Princess IV
ProblemDescription"OK,youarenottoobad,em...Butyoucanneverpassthenexttest."feng5166says."IwilltellyouanoddnumberN,andthenNintegers.Therewillbeaspecialintegeramongthem,youhavetotellmewhichintegeristhesp
lishuzhai
·
2015-03-10 17:00
HDU 1028
Ignatius
and the Princess III
ProblemDescription"Well,itseemsthefirstproblemistooeasy.Iwillletyouknowhowfoolishyouarelater."feng5166says."Thesecondproblemis,givenanpositiveintegerN,wedefineanequationlikethis: N=a[1]+a[2]+a[3]+...
lishuzhai
·
2015-03-10 17:00
hdu 1029
Ignatius
and the Princess IV //map的使用
#include #include #include #include usingnamespacestd; intmain() { intn,i,k; mapa; while(scanf("%d",&n)!=-1){ for(i=0;i(k,1));//map的插入,count()是返回key出现的次数,在map里,key只能是0和1 } else*/ a[k]++;//会自动判断是否存在
Ash_Zheng
·
2015-03-08 11:00
hdu 1026
Ignatius
and the Princess I 广搜+优先队列+记录路径
IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):13414 AcceptedSubmission(s):4232SpecialJudgeProblemDescriptionThePrincesshasbeen
Lionel_D
·
2015-03-04 09:00
优先队列
bfs
and
the
PRI
Ignatius
hdu1026
hdu 1028
Ignatius
and the Princess III 母函数水题,,大家注意了,,我要开始刷母函数了~~
IgnatiusandthePrincessIIITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):14352 AcceptedSubmission(s):10102ProblemDescription"Well,itseemsthefirstproble
Lionel_D
·
2015-03-02 19:00
and
the
PRI
生成函数
Ignatius
母函数
hdu1028
Doing Homework again
pid=1789典型的贪心,也是在这个题上掌握了贪心最典型的标志,也就是排序算法的运用...虽然有点low问题描述:
Ignatius
比赛回来之后,每位老师给
Ignatius
一个交作业的最后期限,如果交不上去就扣分
u014665013
·
2015-02-25 08:00
HDU 1253 胜利大逃亡
ProblemDescriptionIgnatius被魔王抓走了,有一天魔王出差去了,这可是
Ignatius
逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,
jtjy568805874
·
2015-02-19 16:00
HDU
bfs
hdu 1029
Ignatius
and the Princess IV
IgnatiusandthePrincessIVTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32767K(Java/Others)TotalSubmission(s):18626 AcceptedSubmission(s):7532ProblemDescription"OK,youarenottoobad,em...Buty
Lionel_D
·
2015-02-08 11:00
and
the
PRI
Ignatius
hdu1029
Hduoj1251【字典树】
TotalSubmission(s):3AcceptedSubmission(s):1 Font:TimesNewRoman|Verdana|Georgia FontSize:←→ ProblemDescription
Ignatius
u014641529
·
2015-01-28 14:00
c
Hduoj1253【广搜】
TotalSubmission(s):0AcceptedSubmission(s):0 Font:TimesNewRoman|Verdana|Georgia FontSize:←→ ProblemDescription
Ignatius
u014641529
·
2015-01-27 16:00
c
HDOJ
Ignatius
and the Princess IV 1029
IgnatiusandthePrincessIVTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32767K(Java/Others)TotalSubmission(s):18458 AcceptedSubmission(s):7450ProblemDescription"OK,youarenottoobad,em...Buty
ydd97
·
2015-01-22 11:00
HDU1028
Ignatius
and the Princess III(母函数模板)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1028解题思路:母函数模板题。AC代码:#include #include usingnamespacestd; intmain(){ intn; while(~scanf("%d",&n)){ intc1[130],c2[130]; for(inti=0;i<=n;i++){ c1[i]=1; c2
piaocoder
·
2014-12-08 08:00
母函数
HDU1027
Ignatius
and the Princess II
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1027解题思路:求第m个全排列。直接用上STL里面的next_permutation库函数即可。AC代码:#include #include #include usingnamespacestd; intmain() { intn,m; while(scanf("%d%d",&n,&m)!=EOF) {
piaocoder
·
2014-12-05 23:00
全排列
C语言BFS(1)____胜利大逃亡
DescriptionIgnatius被魔王抓走了,有一天魔王出差去了,这可是
Ignatius
逃亡的好机会.
y1196645376
·
2014-11-13 19:00
杭电OJ(HDOJ)1029题:
Ignatius
and the Princess IV(数论)
题意:给出一个长度为N(1 #include usingnamespacestd; intarr[999999]; intcmp(inta,intb) { if(a>n) { for(i=0;i>arr[i]; sort(arr,arr+n,cmp); cout<
u014174811
·
2014-11-09 12:00
算法
ACM
杭电
HDU 1027
Ignatius
and the Princess II (next_permutation)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1027题目大意: 给你一个N个元素的序列为1,2,3……n-1,n组成一个排列。问第M大的排列顺序为多少解题思路:直接用STL中的next_permutationnext_permutation用法:next_permutation(num,num+n);#include #include #inclu
fjy4328286
·
2014-11-04 19:00
STL
HDU-1029-
Ignatius
and the Princess IV
IgnatiusandthePrincessIVTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32767K(Java/Others)TotalSubmission(s):17490 AcceptedSubmission(s):7060ProblemDescription"OK,youarenottoobad,em...Buty
u014355480
·
2014-10-29 17:00
C++
C语言
水题
hdu1029
hdu- 1028
Ignatius
and the Princess III
ProblemDescription"Well,itseemsthefirstproblemistooeasy.Iwillletyouknowhowfoolishyouarelater."feng5166says."Thesecondproblemis,givenanpositiveintegerN,wedefineanequationlikethis: N=a[1]+a[2]+a[3]+...
wojiaohuangyu
·
2014-10-27 22:00
HDU 1251 统计难题(trie树入门)
Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给
Ignatius
统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每
u012965373
·
2014-10-27 11:00
Ignatius
's puzzle(数论)
链接:点击打开链接
Ignatius
'spuzzleTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission
Enjoying_Science
·
2014-10-13 20:00
算法
ACM
组合数学 - 母函数 + 模板题 : 整数拆分问题
Ignatius
and the Princess III Time Limit: 2000/1000 MS (Java/Others) Memory Limit
·
2014-09-18 15:00
函数
组合数学 + STL --- 利用STL生成全排列
Ignatius
and the Princess II Time Limit: 2000/1000 MS (Java/Others) Memory Limit
·
2014-09-15 22:00
STL
hdu1026——
Ignatius
and the Princess I
ProblemDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourprettyPrincess.Nowhegetsintofeng5166'scastle.Thecastleisalargelabyrinth.Tomaketheproblemsimply,weassumet
Guard_Mine
·
2014-09-08 22:00
bfs
HDU 1027
Ignatius
and the Princess II 选择序列题解
直接选择序列的方法解本题,但是最坏时间效率是O(n*n),故此不能达到0MS。使用删除优化,那么就可以达到0MS了。删除优化就是当需要删除数组中的元素为第一个元素的时候,那么就直接移动数组的头指针就可以了,那么时间效率就是O(1)了,而普通的删除那么时间效率是O(n),故此大大优化了程序。如何直接选择第k个序列,可以参考本博客的Leetcode题解。Leetcode题有个一模一样的题目。不过没有使
kenden23
·
2014-08-20 08:00
HDU 1027
Ignatius
and the Princess II (STL全排列)
IgnatiusandthePrincessIITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):4665 AcceptedSubmission(s):2805ProblemDescriptionNowourherofindsthedoortotheBEe
u014569598
·
2014-08-19 21:00
HDU 1026
Ignatius
and the Princess I 迷宫广搜剪枝问题
本题是个经典的迷宫广搜问题类型了。网上看到好多解法。很多解题报告都没什么分析,更不会指出其中的关键点。代码更加像一大抄。有人分析也一大篇分析,不过全部都不切中关键,甚至在分析什么广搜和深搜区别,广搜为什么快之类的,还有喊什么暴搜之类的,全错了。估计这些代码都是抄过的。通过一大段的时间研究,终于搞通了。本题虽然可以说是广搜,但是其中的关键却是剪枝法,为什么呢?因为迷宫并不能简单地广搜就能搜索出所有路
kenden23
·
2014-08-19 12:00
hd1028
Ignatius
and the Princess III【母函数】
IgnatiusandthePrincessIIITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):12832 AcceptedSubmission(s):9080ProblemDescription"Well,itseemsthefirstproblem
u012678352
·
2014-08-12 16:00
hdu 1028
Ignatius
and the Princess III
IgnatiusandthePrincessIIITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):12758 AcceptedSubmission(s):9016ProblemDescription"Well,itseemsthefirstproblem
u013806814
·
2014-08-08 22:00
c
HDU
杭电
母函数
jobdu1456 胜利大逃亡
pid=1456题目描述:
Ignatius
被魔王抓走了,有一天魔王出差去了,这可是
Ignatius
逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始
Ignatius
xtzmm1215
·
2014-08-04 02:00
hdu 1028
Ignatius
and the Princess III(母函数,完全背包)
http://acm.hdu.edu.cn/showproblem.php?pid=1028整数划分问题。第一道母函数。。。母函数入门小于等于n的整数共有n个,1,2......n,每个数都有无限多个,对于整数1,它所对应的母函数为(1+x+x^2+...+x^k+...),整数2对应的母函数为(1+x^2+X^4+...+x^(2*k)+...),整数3对应的母函数为(1+x^3+x^6+...
u013081425
·
2014-07-27 14:00
母函数
HDU1028
Ignatius
and the Princess III 【母函数模板题】
IgnatiusandthePrincessIIITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):12521 AcceptedSubmission(s):8838ProblemDescription"Well,itseemsthefirstproblem
u012846486
·
2014-07-25 17:00
hdu1028
1123: 统计难题 (字典树)
1123:统计难题时间限制: 1Sec 内存限制: 128MB提交: 4 解决: 4[提交][状态][讨论版]题目描述
Ignatius
最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现
u014253173
·
2014-07-24 10:00
ACM
hdu 1028
Ignatius
and the Princess III 母函数/dp
题意:给定一个数n,进行整数划分,有多少种方法?例如4=1+1+1+1=2+1+1=2+2=3+1=4共5种。题解:有两种方法:母函数和dp。1)母函数。我们先需要了解母函数,对于一个序列ai,g(x)=a0+a1x+a2x^2+...,g(x)就是母函数,也成为生成函数。拿这道题来说,我们可以把都是1的组合表示为1+x+x^2+x^3+...,这其中kx^n表示就表示将n划分成全为1的数有k种方
a601025382s
·
2014-07-23 09:00
dp
母函数
1407220953-hd-
Ignatius
and the Princess IV.cpp
#include#includeintstr[1005000],s[1005000];intmain(){ intn,i,k,max; while(scanf("%d",&n)!=EOF) { memset(s,0,sizeof(s)); max=-1; for(i=0;i=(n+1)/2) printf("%d\n",i); } return0;} //RE#include#
wangluoershixiong
·
2014-07-22 20:00
HDU1026
Ignatius
and the Princess I 【BFS】+【路径记录】
IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):11710 AcceptedSubmission(s):3661SpecialJudgeProblemDescriptionThePrincesshasbeen
u012846486
·
2014-07-22 14:00
hdu1026
hdu 1026
Ignatius
and the Princess I BFS
题意:给定一个n*m的迷宫,起点在(0,0),终点在(n-1,m-1);规则如下:1)每次移动只能上下左右方向移动一格,耗时1秒,不能到迷宫外。2)迷宫上的各个字符意义为:‘.’,表示可以走的路。‘X’,表示不可以走的陷阱。‘n’,n为数字,(1 #include #include #include #include #include #include #include usingnamespac
a601025382s
·
2014-07-22 10:00
bfs
HDU1027
Ignatius
and the Princess II 【next_permutation】【DFS】
IgnatiusandthePrincessIITimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):4571 AcceptedSubmission(s):2733ProblemDescriptionNowourherofindsthedoortotheBEe
u012846486
·
2014-07-21 22:00
hdu1027
HDU 1429 胜利大逃亡(状态,宽搜)
64bitIOFormat:%I64d&%I64uSubmit StatusDescriptionIgnatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)……这次魔王汲取了上次的教训,把
Ignatius
u014569598
·
2014-07-01 14:00
HDU1026
Ignatius
and the Princess I 优先队列宽搜+路径输出
K- IgnatiusandthePrincessITimeLimit:1000MS MemoryLimit:32768KB 64bitIOFormat:%I64d&%I64uSubmit StatusDescriptionThePrincesshasbeenabductedbytheBEelzebubfeng5166,ourheroIgnatiushastorescueourpr
u014569598
·
2014-06-29 09:00
HDU--1253---胜利大逃亡 广度优先搜索
TotalSubmission(s):21542 AcceptedSubmission(s):8479ProblemDescriptionIgnatius被魔王抓走了,有一天魔王出差去了,这可是
Ignatius
u013480370
·
2014-06-28 10:00
hdu1027
Ignatius
and the Princess II (全排列 & STL中的神器)
转载请注明出处:http://blog.csdn.net/u012860063题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1027IgnatiusandthePrincessII ProblemDescriptionNowourherofindsthedoortotheBEelzebubfeng5166.Heopensthedoorandfinds
u012860063
·
2014-06-22 15:00
STL
HDU
全排列
HDU 1253 胜利大逃亡 NYOJ 523【BFS】
TotalSubmission(s):24608 AcceptedSubmission(s):9427ProblemDescriptionIgnatius被魔王抓走了,有一天魔王出差去了,这可是
Ignatius
u012846486
·
2014-06-18 09:00
HDU
1253
HDU1253:胜利大逃亡(BFS,三维处理)
Other)TotalSubmission(s):53 AcceptedSubmission(s):25ProblemDescriptionIgnatius被魔王抓走了,有一天魔王出差去了,这可是
Ignatius
u014569598
·
2014-05-31 10:00
[ACM] hdu 1251 统计难题 (字典树)
Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给
Ignatius
统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个
sr19930829
·
2014-05-24 21:00
ACM
字典树
HDU 1029
Ignatius
and the Princess IV
题意:先输入一个数N,然后输入N个数,找出出现了(N+1)/2次的数。 思路:开数组直接统计 这题貌似没有什么算法啊,题目说得越来越NB,实际上题越来越水,直接水过。。。#include #include #include #include #include #include #include #include #include #include #include #inclu
squee_spoon
·
2014-05-22 16:00
HDU
HDU 1028
Ignatius
and the Princess III
题意:把一个正整数N表示为若干个正整数的和,输出有多少种表示方法。 思路:DP 思考过程是这样的。设a[1]>=a[2]>=a[3]...,因为N=a[1]+a[2]+a[3]+...。N减去a[1]后,N-a[1]成为了原问题的一个子问题。开一个二维数组DP[122][122],DP[N][M]表示正整数N的最大加数为M的分解方法数。递归法+存储结果(0ms):#includ
squee_spoon
·
2014-05-22 16:00
dp
HDU
HDU 1027
Ignatius
and the Princess II
题意:求N个数(1,2,3,...,N-1,N)的全排列中第M小的数。 思路:康托展开逆过程。 因为前些天刚学输出全排列,看到这道题就有一个想法,从小到大求全排列并计数,求到第M个的时候输出,结果果断超时了。又仔细思考了一下,发现这个题和康托展开很像,康托展开是求一个序列在全排列中的次序,这个题刚好反过来,求第M小的排列。于是开始找规律,在纸上列了一些sample,发现从右往左
squee_spoon
·
2014-05-22 14:00
HDU
上一页
7
8
9
10
11
12
13
14
下一页
按字母分类:
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
其他