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
NEFU
nefu
84
#include usingnamespacestd; longlongExtended_Gcd(longlonga,longlongb,longlong&x,longlong&y) { if(b==0) { x=1; y=0; returna; } longlongd=Extended_Gcd(b,a%b,x,y); longlongt=x-(a/b)*y; x=y; y=t; return
Hearthougan
·
2013-12-10 17:00
同余问题
NEFU
:115 斐波那契的整除
这个算是开了数学正式的第一道题了。斐波那契数列博大精深。。质数数量斐波那契数列的整除性与素数生成性每3个连续的数中有且只有一个被2整除,每4个连续的数中有且只有一个被3整除,每5个连续的数中有且只有一个被5整除,每6个连续的数中有且只有一个被8整除,每7个连续的数中有且只有一个被13整除,每8个连续的数中有且只有一个被21整除,每9个连续的数中有且只有一个被34整除,.......可以看出n——>
kkkwjx
·
2013-10-26 16:00
数论
斐波那契数列
NEFU
262 贪吃的九头龙(树形背包,4级)
贪吃的九头龙TimeLimit1000msMemoryLimit65536Kdescription传说中的九头龙是一种特别贪吃的动物。虽然名字叫“九头龙”,但这只是说它出生的时候有九个头,而在成长的过程中,它有时会长出很多的新头,头的总数会远大于九,当然也会有旧头因衰老而自己脱落。 有一天,有M个脑袋的九头龙看到一棵长有N个果子的果树,喜出望外,恨不得一口把它全部吃掉。可是必须照顾到每个头,因此它
nealgavin
·
2013-09-17 10:00
NEFU
2 猜想(数论&筛法)
猜想http://acm.
nefu
.edu.cn/test/problemshow.php?
synapse7
·
2013-08-12 14:00
NEFU
118 n!后面有多少个0(数论)
后面有多少个0http://acm.
nefu
.edu.cn/test/problemshow.php?
synapse7
·
2013-08-12 14:00
NEFU
84 五指山(扩展欧几里得)
http://acm.
nefu
.edu.cn/test/problemshow.php?
synapse7
·
2013-08-12 14:00
NEFU
117 素数个数的位数(数论)
http://acm.
nefu
.edu.cn/test/problemshow.php?
synapse7
·
2013-08-12 14:00
NEFU
119 组合素数(数论)
组合素数http://acm.
nefu
.edu.cn/test/problemshow.php?
synapse7
·
2013-08-12 14:00
NEFU
115 斐波那契的整除(数论&整除推导)
斐波那契的整除http://acm.
nefu
.edu.cn/test/problemshow.php?
synapse7
·
2013-08-10 21:00
NEFU
705(数论+DP)
题目:Heap#include #include #include usingnamespacestd; typedeflonglongLL; constintN=1001000; constintMOD=20000003; LLdp[N]; voidextend_Euclid(inta,intb,int&x,int&y) { if(b==0) { x=1; y=0; return; }
ACdreamers
·
2013-08-04 19:00
NEFU
704(AC自动机+状态压缩)
题目:PasswordLeakage#include #include #include #include usingnamespacestd; charS[1000010]; charkeyword[51]; charstr[51]; charT[51]; classTrie { public: intcount; Trie*fail; Trie*next[26]; Trie() { co
ACdreamers
·
2013-08-04 19:00
nefu
120 梅森素数
nefu
120梅森素数Lucas-Lehmer判定法(详见HIT数论及其应用P38)#include #include usingnamespacestd; typedeflonglongll; lldata
z690933166
·
2013-07-23 14:00
nefu
118 119(算术基本定理的应用)
nefu
118 n!后面有多少个0统计n!里面有素数5的幂即可。
z690933166
·
2013-07-23 10:00
NEFU
709(第K个圆的半径)
题目:TheKthCircle 题意:平面上给定n个点的坐标,我们可以选其中3点构成一个圆,当然也就有3段弧,我们定义第K个圆满足条件:(1)除了已选的3个点,剩下的n-3个点中有K个点在圆内,有n-K-1个点在圆外(2)保证所有的点在圆的三条弧中其中一条弧的一侧解析:本题实际上就是得到这样一个结论,满足条件的圆其中有两点一定在这些点的凸包上,并且这两点相邻,这样我们就可以先求凸包,然后枚举凸包的
ACdreamers
·
2013-07-22 20:00
nefu
117 素数个数的位数(素数定理)
题目内容素数定理:随着x的增长,小于正实数x的素数个数与x/lnx的值越来越接近。#include #include usingnamespacestd; intmain() { doublen,m; while(cin>>n) { m=double(n-log10(n)-log10(log(10))); cout<<int(m)+1<<endl; } return0; }
z690933166
·
2013-07-22 18:00
NEFU
725 Number Guessing 枚举
NumberGuessingTimeLimit1000msMemoryLimit65536KdescriptionNumberGuessingisacomputergame.First,thecomputerchoosesfourdifferentdigits,youneedtoguessthesefourdigitsinthefewesttimes,foreachguess,thecompute
cyendra
·
2013-06-06 15:00
题解
NEFU
722 Anagram 全排列 STL
AnagramTimeLimit4000msMemoryLimit65536KdescriptionYouaretowriteaprogramthathastogenerateallpossiblewordsfromagivensetofletters.Example:Giventheword"abc",yourprogramshould-byexploringalldifferentcombin
cyendra
·
2013-06-06 15:00
题解
NEFU
721 Substrings exp 枚举
SubstringsexpTimeLimit1000msMemoryLimit65536KdescriptionYouaregivenanumberofcase-sensitivestringsofalphabeticcharacters,findthelargeststringX,suchthateitherX,oritsinversecanbefoundasasubstringofanyoft
cyendra
·
2013-06-06 15:00
题解
算法设计基础
算法设计基础①思维的体操②问题求解常见策略GeneralProblemSolvingTechniques③高效算法设计举例DesigningEfficientAlgorithms ④动态规划专题⑤小结与习题暴力
NEFU
722Anagram
cyendra
·
2013-06-05 08:00
NEFU
708 Longest Non-decreasing Substring(线段树+DP)
LongestNon-decreasingSubstringTimeLimit1000msMemoryLimit65536KdescriptionYouaregivenastringSnolongerthan100,000consistingofcharacters0-9only.AndtwokindsofoperationswillbeperformedonS: Flipij:foreachi
nealgavin
·
2013-05-11 16:00
nefu
697Similar Word(kmp)
SimilarWordTimeLimit1000msMemoryLimit65536KdescriptionItwasacrummydayforLur.HefailedtopasstotheCET-6(CollegeEnglishTestBand-6).Lookingbackonhowitwasinlastyeargoneby,hegraduallynoticedhehadfledtoomanyE
nealgavin
·
2013-05-05 20:00
NEFU
700 Car race game 树状数组
CarracegameTimeLimit1000msMemoryLimit65536KdescriptionBobisagameprogrammingspecialist.Inhisnewcarracegame,therearesomeracers(nmeanstheamountofracers(1 outputForeachdatasetintheinputprintonaseparatelin
cyendra
·
2013-05-05 20:00
题解
NEFU
699 Lucky Boy 博弈?几何?
LuckyBoyTimeLimit1000msMemoryLimit65536KdescriptionRecently,Lurhaveagoodluck.Heisalsothecleverestboyinhisschoolashecreatethemostpopularcomputergame–LuckyBoy.Thegameisplayedbytwoplayers,aandb,in2dplana
cyendra
·
2013-05-05 20:00
题解
NEFU
698 Post office 大概是dp?
PostofficeTimeLimit1000msMemoryLimit65536KdescriptionThereareN(N #include #include usingnamespacestd; longlonga[1111]; longlongf[1111]; longlongg[1111]; intn; intq; intmain() { while(~scanf("%d",&
cyendra
·
2013-05-05 20:00
题解
dp
NEFU
697 Similar Word KMP
SimilarWordTimeLimit1000msMemoryLimit65536KdescriptionItwasacrummydayforLur.HefailedtopasstotheCET-6(CollegeEnglishTestBand-6).Lookingbackonhowitwasinlastyeargoneby,hegraduallynoticedhehadfledtoomanyE
cyendra
·
2013-05-05 20:00
题解
NEFU
696 Dart game 背包dp
DartgameTimeLimit1000msMemoryLimit65536KdescriptionDartsoriginatedinAustralia.Australia'saboriginesinitiallyforhuntingandhittheenemy'sweapon. Agameofdartsinwhichtheplayersattempttoscorepointsbythrowin
cyendra
·
2013-05-05 20:00
题解
dp
nefu
696 Dart game(dp背包)
DartgameTimeLimit1000msMemoryLimit65536KdescriptionDartsoriginatedinAustralia.Australia'saboriginesinitiallyforhuntingandhittheenemy'sweapon. Agameofdartsinwhichtheplayersattempttoscorepointsbythrowin
nealgavin
·
2013-05-05 20:00
nefu
702 The minimum square sum(数论)
TheminimumsquaresumTimeLimit1000msMemoryLimit65536KdescriptionGivenaprimep(p #include #include #include #include usingnamespacestd; intmain() { longlongp; while(cin>>p) { if(p==2)cout<<"2"<
nealgavin
·
2013-05-05 14:00
nefu
700 Car race game(离散化+线段树)
CarracegameTimeLimit1000msMemoryLimit65536KdescriptionBobisagameprogrammingspecialist.Inhisnewcarracegame,therearesomeracers(nmeanstheamountofracers(1 outputForeachdatasetintheinputprintonaseparatelin
nealgavin
·
2013-05-05 14:00
NEFU
688 Word maker! 网络流
Wordmaker!TimeLimit5000msMemoryLimit65536KdescriptionProbably,youhaveseenpolyhedronswhichhaveanEnglishletteroneachfaceofthem.LittleAlihassomeofthesepolyhedronsandsomewordsinhismind.Wewanttoknowhowmany
cyendra
·
2013-04-30 20:00
图论
nefu
2 - 猜想
遍历2-n/2的所有的数,如果i和n-i都是素数的话就累加上1。。。代码如下:#include #include #defineM16777250 boolis_prime[M]; voidjudge() { intlen=sqrt(M+0.5); for(inti=2;i<=len;i++)if(is_prime[i]==0) for(intj=i*i;j<=M;j+=i)is_prime[j]
shankeliupo
·
2013-04-30 14:00
nefu
117 - 素数个数的位数
以前没注意到floor()返回的是double型的数据,素数定理的应用,,,代码如下:#include #include intmain() { longlongn; while(scanf("%lld",&n)==1) { doublett=log10(n)+log10(log(10.0)); printf("%.0lf\n",floor(n-tt)+1); } return0; } 犯错代码:
shankeliupo
·
2013-04-30 13:00
nefu
680(字典树DP)
EnglishGameTimeLimit1000msMemoryLimit65536KdescriptionThisEnglishgameisasimpleEnglishwordsconnectiongame. Therulesareasfollows:thereareNEnglishwordsinadictionary,andeverywordhasitsownweightv.Thereisaw
nealgavin
·
2013-04-29 21:00
nefu
674HELP(bfs)
HELPTimeLimit1000msMemoryLimit65536KdescriptionYouareawarrior,butyourdearprincesswascaughtbybigdevil.youwanttosavetheprincess.eachround,youcangoaround(up,down,left,right),iftheplaceyoustandisaslimeors
nealgavin
·
2013-04-29 21:00
NEFU
English Game 字符串 dp 字典树
EnglishGameTimeLimit1000msMemoryLimit65536KdescriptionThisEnglishgameisasimpleEnglishwordsconnectiongame. Therulesareasfollows:thereareNEnglishwordsinadictionary,andeverywordhasitsownweightv.Thereisaw
cyendra
·
2013-04-29 11:00
题解
dp
动态规划
nefu
84 - 五指山
扩展欧几里德算法列方程dt-ln=y-x求基础解,在求最小t解代码如下:#include voidgcd(longlonga,longlongb,longlong&d,longlong&x,longlong&y) { if(b==0){x=1;y=0;d=a;} else{gcd(b,a%b,d,y,x);y-=(a/b)*x;} } intmain() { longlongn,d,x,y; in
shankeliupo
·
2013-04-28 21:00
NEFU
663 Emergency 最短路 floyd
EmergencyTimeLimit3000msMemoryLimit65536KdescriptionKudo’srealnameisnotKudo.HernameisKudryavkaAnatolyevnaStrugatskia,andKudoisonlyhernickname. Now,sheisfacinganemergencyinherhometown: Hermotherisdevel
cyendra
·
2013-04-27 19:00
题解
图论
nefu
661 Clockwise 水DP+略几何
ClockwiseTimeLimit1000msMemoryLimit65536KdescriptionSayahavealongnecklacewithNbeads,andshesignsthebeadsfrom1toN.ThenshefixesthemtothewalltoshowN-1vectors–vectoristartsfrombeadiandendupwithbeadi+1. One
cyendra
·
2013-04-27 15:00
题解
dp
动态规划
NEFU
657 Reverse a Road(SPFA)
ReverseaRoadTimeLimit1000msMemoryLimit65536KdescriptionPeterresidesinthecityofNanuh,andgoestohisworkingplaceinthiscityeveryweekday.Hehasbeentotallyannoyedwiththeroadtrafficofthiscity.Alltheroadsinthis
nealgavin
·
2013-04-20 19:00
NEFU
655 Trip(DP)
TripTimeLimit1000msMemoryLimit65536KdescriptionXiaowanghasanewcar,sohewantstohaveatripfromhishometohefei,however,thereisnoroadfromhishousedirectlytoHefei,sohehastogothroughanumberofcitiestogettohefei,
nealgavin
·
2013-04-20 19:00
NEFU
654 Magic Tree(DP)
MagicTreeTimeLimit1000msMemoryLimit65536KdescriptionEveryacmerdreamforgoldmedal.Fotunately,therearetwomagictrees(whichareconvenientlynumbered1and2)inourcampus,eachfullofgoldmedal.Thetreesareveryhigh,s
nealgavin
·
2013-04-20 19:00
NEFU
653 Grids(water)
GridsTimeLimit1000msMemoryLimit65536KdescriptionOnan1×1grid,partitionthelengthandwidthinto50parts,forming2500unitgridswiththesamesize.Now,givenncircleswithequalradiusRonthegrid.Findthetotalnumberofuni
nealgavin
·
2013-04-20 19:00
扩展欧几里德 之 五指山
nefu
84
五指山TimeLimit1000msMemoryLimit65536Kdescription西游记中孙吾空大闹天宫,如来佛祖前来降伏他,说道:“我与你打个赌赛;你若有本事,一筋斗打出我这右手掌中,算你赢,再不用动刀兵苦争战,就请玉帝到西方居住,把天宫让你;若不能打出手掌,你还下界为妖,再修几劫,却来争吵。” 那大圣闻言,暗笑道:“这如来十分好呆!我老孙一筋斗去十万八千里。他那手掌,方圆不满一尺,如
gaotong2055
·
2013-04-17 13:00
扩展欧几里德 之 五指山
nefu
84
五指山 Time Limit 1000ms Memory Limit 65536K description 西游记中孙吾空大闹天宫,如来佛祖前来降伏他,说道:“我与你打个赌赛;你若有本事,一筋斗打出我这右手掌中,算你赢,再不用动刀兵苦争战,就请玉帝到西方居住,把天宫让你;若不能打出手掌,你还下界为妖,再修几劫,却来争吵。” 那大圣闻言,
从此醉
·
2013-04-17 13:00
扩展
POJ3130(还是判断多边形的内核是否存在)
/* Goujinping2013.4.12
NEFU
Themasterpl
ACdreamers
·
2013-04-12 20:00
POJ1279(求多边形内核的面积)
/* Goujinping2013.4.12
NEFU
ThemasterplateofPolygonkernel.
ACdreamers
·
2013-04-12 19:00
POJ3335(判断多边形内核是否存在)
/* Goujinping2013.4.12
NEFU
ThemasterplateofPolygonkernel.
ACdreamers
·
2013-04-12 19:00
Codeforces problem 67E(多边形求内核的应用)
/* Goujinping2013.4.12
NEFU
ThemasterplateofPolygonkernel.
ACdreamers
·
2013-04-12 18:00
NEFU
635(二分+枚举)
题目:TwinkleTwinkleLittleStar 题意:就是给n个点的坐标,然后在这个图形中找出一个边长最小的正方形,要求正方形的边平行于坐标轴且覆盖的点大于等于k个。#include #include #include #include usingnamespacestd; constintN=200010; constintINF=999999999; stru
ACdreamers
·
2013-04-12 13:00
NEFU
485 分配问题
分配问题TimeLimit1000msMemoryLimit65536Kdescription有n件工作要分配给n个人做。第i个人做第j件工作产生的效益为ijc。试设计一个将n件工作分配给n个人做的分配方案,使产生的总效益最大。对于给定的n件工作和n个人,计算最优分配方案和最差分配方案。input多组数据输入.每组输入第1行有1个正整数n#includeusingnamespacestd;cons
cyendra
·
2013-04-10 20:52
图论
题解
解题报告
图论
上一页
4
5
6
7
8
9
10
11
下一页
按字母分类:
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
其他