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
joj
joj
1171
水题,做1089太郁闷了所以刷了到水题,代码很笨,基本没有参考价值,只为看一眼快把我折磨死的气球。。。。。。。。。。。#include#includeusingnamespacestd;charstr1[1005],str2[1005];intmain(){ while(scanf("%s%s",str1,str2)!=EOF) { intlen1,len2,i=0;
qiankun1993
·
2011-11-06 18:00
joj
2343
我这辈子都会记住这个定理:n元循环群(a)中,元素a^m是(a)的生成元的充要条件是(n,m)=1.哎,郁闷。。。。#include#includeusingnamespacestd;intmain(){ intn,m; while(scanf("%d%d",&n,&m)!=EOF) { inta,b; if(n>m) { a=n
qiankun1993
·
2011-11-06 17:00
c
joj
1387
又见0-1背包,长度既是价值也是体积。#include#includeusingnamespacestd;intdp[100000];intcd[105];intmain(){ intcd_sto; while(scanf("%d",&cd_sto)!=EOF) { intn; scanf("%d",&n); inti,j; for(i=
qiankun1993
·
2011-11-04 20:00
joj
1078 hdu 1116
欧拉回路在加上并查集判断连通性,把每一个单词当做一个边,话说我一开始当做h路做的。。。。。#include#include#includeusingnamespacestd;intfather[26],rank[26],r[26],c[26],mark[26];intfind(intx){ //coutrank[y]) { father[y]=x; } else
qiankun1993
·
2011-11-03 23:00
joj
1317
各种序。。。。。。。。。。。#include#include#includeusingnamespacestd;voidtree(char*s1,char*s2){ if(s1[0]=='\0') return; elseif(s1[1]=='\0') { printf("%c",s1[0]); return; } inti
qiankun1993
·
2011-10-30 15:00
c
tree
joj
2035
一开始超时,怎么改都超时,后来果断把stl换成纯数组,竟然AC了,莫非stl的操作很费时间吗,不解:之前的超时stl版:#include#include#includeusingnamespacestd;intmark[10005];intmain(){ intn; while(scanf("%d",&n),n>0) { if(n==0) continue;
qiankun1993
·
2011-10-30 10:00
ini
joj
1968
1968:CommonSubsequenceResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE1s4096K761222StandardAsubsequenceofagivensequenceisthegivensequencewithsomeelements(possiblenone)leftout.GivenasequenceX=anotherseq
hechenghai
·
2011-10-29 00:00
joj
1329 二叉树
给出中根序列和后根序列求路径值最小的叶节点,各种队,各种栈(话说一开始理解错题了,英语不好的悲哀) #include#include#includeusingnamespacestd;intmmaaxx;intk;voidtree(stacks1,stacks2,intm){ if(s1.size()==1&&s2.size()==1) { if((m+s1.top())p
qiankun1993
·
2011-10-28 21:00
tree
joj
1829
1829:CandiesResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K922220StandardAllchildrenlikecandies.OnedayagroupofchildrenaredividingMcandiesbythefollowingrules.1.Thecandiesarenumberedwith1,2,3…M.2
hechenghai
·
2011-10-27 23:00
joj
2529
2529:ChorusResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE1s65536K551154StandardN位同学站成一排,音乐老师要请其中的(N-K)位同学出列,使得剩下的K位同学排成合唱队形。 合唱队形是指这样的一种队形:设K位同学从左到右依次编号为1,2…,K,他们的身高分别为T1,T2,…,TK, 则他们的身高满足T1…>TK(
hechenghai
·
2011-10-26 11:00
JOJ
1043:Atlantis 离散化+扫描线
JOJ
1043:Atlantis离散化+扫描线 1043:AtlantisResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K431155StandardThereareseveralancientGreektextsthatcontaindescriptionsofthefabledislandAtlantis.Someofthesetext
第七天堂
·
2011-10-25 23:00
JOJ
1040:Trees(卡特兰数+递归)
JOJ
1040:Trees(卡特兰数+递归)Wecannumberbinarytreesusingthefollowingscheme:Theemptytreeisnumbered0.Thesingle-nodetreeisnumbered1
第七天堂
·
2011-10-25 20:00
JOJ
1037:Operand
JOJ
1037:OperandProfessorMapleteachesmathematicsinauniversity.Hehaveinventedafunctionforthepurposeofobtainingtheoperandsfromanexpression.Thefunctionnamedop
第七天堂
·
2011-10-25 19:00
joj
1435
1435:GoldbachResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K787206StandardGoldbach'sConjecture: Foranyevennumber n greaterthanorequalto4,thereexistsatleastonepairofprimenumbers p1 and p2 suchth
hechenghai
·
2011-10-23 23:00
joj
1240
1240:TheDecoderResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K849169StandardWriteacompleteprogramthatwillcorrectlydecodeasetofcharactersintoavalidmessage.Yourprogramshouldreadagivenfileofasimpl
fangzhiyang
·
2011-10-23 16:00
Scheme
IBM
null
input
character
encoding
joj
2318
2318:DiamondResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s16384K1552578StandardDrawadiamondshapewithcharacter'*'.InputThereareseverallinesintheinput,eachlineisaintegerN(N #include usingnamespaces
fangzhiyang
·
2011-10-23 16:00
Integer
ini
input
character
each
output
joj
2201
2201:PrimeandDecompoundingResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K400209StandardApositiveintergerexcept1canbedecompoundedtothesumofseveralprimenumbers(includeonlyonenumber).Forexsample,f
hechenghai
·
2011-10-22 23:00
input
include
Exchange
output
Numbers
Forms
joj
1583
1583:LetMeCountTheWaysResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K551231StandardAftermakingapurchaseatalargedepartmentstore,Mel'schangewas17cents.Hereceived1dime,1nickel,and2pennies.Latertha
hechenghai
·
2011-10-22 23:00
joj
1424
1424:CoinChangeResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K700243StandardSupposethereare5typesofcoins:50-cent,25-cent,10-cent,5-cent,and1-cent.Wewanttomakechangeswiththesecoinsforagivenamoun
hechenghai
·
2011-10-22 23:00
joj
2474
先找各阶段的状态,再dp规律是:2*1的不同的数目为2;2*2的不同的数目为7;2*3的不同的数目为8;以下全为8,注意这里说的不同的数目是指2*n中横跨n个格的放法,即不可分割的放法。 #include#includeusingnamespacestd;intdp[101];intmain(){ intn,i; memset(dp,0,sizeof(dp)); dp[1]=2;
qiankun1993
·
2011-10-21 21:00
joj
2308
贪心,弄个2重循环,每次取最优就可以了。#include#include#include#includeusingnamespacestd;inta[52];intmain(){ intn,k; while(scanf("%d%d",&n,&k)!=EOF) { inti,j; for(i=1;i=k) {
qiankun1993
·
2011-10-21 19:00
joj
2325
据说要用dp,不过我用的是BFS,就是从上下左右四个方向压缩,在余下的面积不小于max的情况下一直到压缩出全为一的子阵,然后更新max的值,反复进行这个操作,即一开始的矩阵为:1111000011110000可以压缩为:0000 (去掉第一行)11110000 1111 (去掉第四行)00001111 111(去掉第一列)000111000 111(去掉第四列)000111000然后反复压缩
qiankun1993
·
2011-10-21 17:00
joj
1270
1270:TriangleWaveResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K1339684StandardInthisproblemyouaretogenerateatriangularwaveformaccordingtoaspecifiedpairofAmplitudeandFrequency.InputandOutputThei
fangzhiyang
·
2011-10-19 18:00
joj
1995
1995:EnergyResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s10240K1336351StandardMr.Jojerisaveryfamouschemist.Heisdoingaresearchaboutbehaviorofagroupofatoms.Atomsmayhavedifferentenergyandenergycanbepo
hechenghai
·
2011-10-11 23:00
joj
2511
2511:NumbertriangleResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE1s65536K427217Standard5 34 812 5436 21798 AnumbertrangleiscomposedofN(N#includeusingnamespacestd;inta[100+3][100+3];ints[100+3][100+3]
hechenghai
·
2011-10-07 21:00
Integer
input
Path
each
output
Numbers
JOJ
2474:Tile My Corridor 平铺棋盘 状态压缩解法
dfs找状态没找明白 ,直接手写的状态转移,反正就2^2的情况。#include #include /* constintmod=2008; intf[106]; intmain() { f[0]=1;f[1]=2;f[2]=11;f[3]=7*f[1]+2*f[2]+2; f[4]=f[3]*2+f[2]*7+f[1]*6+f[0]*2; for(inti=5;i=2)
jxy859
·
2011-10-07 19:00
[置顶]
joj
神一般的循序渐进200题 扩充版
转载地址:http://blog.csdn.net/jxy859/article/details/6324181Level0(试试吧,电脑判题很神奇的):AC掉 1000(TheA+BProblem) 吧!(一二阶段,共49题,每天至少三题,由简到难)Level1(格式入门,熟悉OJ):2484(格式控制) 2357(排序) 1012(数论,最大公约
hechenghai
·
2011-10-05 20:00
joj
2645
http://acm.jlu.edu.cn/
joj
/showproblem.php?
hechenghai
·
2011-10-04 20:00
joj
2252
[新版judge已支持specialjudge;增加了提交后的状态页面;增加对提交代码的语言检查][新版judge系统近日试运行,希望可以解决内存越界导致Waiting的问题] [more]Welcome, �γɺ�[JPoints: 1207,Sender!: 0/17] 2252:PickBallsResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s
hechenghai
·
2011-10-04 16:00
Integer
System
input
语言
each
output
joj
1751
1751:UglyNumbersResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K1168351StandardUglynumbersarenumberswhoseonlyprimefactorsare2,3or5.Thesequence1,2,3,4,5,6,8,9,10,12,15,...showsthefirst11uglynumbe
hechenghai
·
2011-10-04 14:00
System
input
output
Numbers
joj
2653
2653:不同的数ResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s65536K40982Standard原来有n对数字,每对两个数字都相同。现在其中某对数字中的一个发生了变化。并且所有数字被打乱了顺序。求这一对数字变化后是多少。要求先输出小的。再输出大的。Input多组输入,每组如下:第一行一个数字n,n#includeusingnamespace
hechenghai
·
2011-10-02 17:00
joj
2645
并查集的一道题,绞尽脑汁想了用并查集算法但总是过不去,后来在网上查了代码(最近好像总是每次都有一个小错误过不去,蛋疼啊),发现了原来是sum应该定义为longlong--,但我不会用那东西,毕竟不同的oj对他的输入输出控制不同,所以用的double,最后发现竟然挤进了这道前十,对我是莫大的鼓舞啊:#include#include#includeusingnamespacestd;structta
qiankun1993
·
2011-09-29 12:00
joj
2236
2236:BalanceandPoiseResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE5s8192K311141Standard工匠大师Hill打造出一个精致的天平,对他的徒弟Oren说:“你帮我做一些砝码配套,为了方便携带,砝码数目要尽量少”。Oren:“好。我将按照2进制的规则打造,也就是1,2,4,8,16等等,这样在称量同等重量下使用的砝码数
hechenghai
·
2011-09-27 18:00
joj
2243
2243:EndlessCarryResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K827306Standard作为2进制的加法,从k加1变成k+1可能会出现若干进位。如1011加1就会有2个进位。给定n,从0开始不停地加1直到n,计算在此过程中总共会有多少次进位。Input输入的每一行有单独的一个值n。n=0标志输入结束Output对于输
hechenghai
·
2011-09-23 20:00
joj
2536
计算几何求解最小外接矩形的问题,这道题是暑假训练时做的一道题,当时不会做,选拔赛在即,突然想看看自己进步了多少,便做了一下,想法很容易就有了(说明进步了。。),但总是wa,逼我买了前辈的代码(178point啊),但还是找不到哪错了,最后终于发现最后四个数的初始化有问题,天,我已经初始化为整形最大值了(数据为double类型),还是不够大,天知道他给的测试数据有多变态。。。。话说马上选拔赛了,
qiankun1993
·
2011-09-23 18:00
joj
1805
求外接圆圆心的一道题#include#include#includeusingnamespacestd;structPoint{ doublex; doubley;};Point circle_center(Point pt[3]) { double x1,x2,x3,y1,y2,y3; double x = 0; d
qiankun1993
·
2011-09-22 22:00
c
joj
2218
2218:StampsResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE5s8192K299151StandardBackground EverybodyhatesRaymond.He'sthelargeststampcollectoronplanetearthandbecauseofthathealwaysmakesfunofalltheothersa
hechenghai
·
2011-09-22 19:00
joj
2170
2170:TravelResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K495177StandardMikewanttotravelaroundintheholiday,sohefoundsomeinfo.ThetravelstartsatthetimeSandendsatF.Mikewanttodomoretavellingwithout
hechenghai
·
2011-09-22 19:00
Integer
ini
input
each
n2
output
joj
1538
1538:PacketsResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K311108StandardAfactoryproducesproductspackedinsquarepacketsofthesameheight h andofthesizes , , , , , .Theseproductsarealwaysdeliv
hechenghai
·
2011-09-22 18:00
File
null
input
each
output
joj
1184
用得非常笨的方法:#include#include#includeusingnamespacestd;#define pi3.141592653589793intmain(){ doublea1,a2,a3,b1,b2,b3,x,y; while(scanf("%lf%lf%lf%lf%lf%lf",&a1,&b1,&a2,&b2,&a3,&b3)!=EOF) { d
qiankun1993
·
2011-09-21 19:00
joj
1048
1048:WoodenSticksResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K884291StandardThereisapileofnwoodensticks.Thelengthandweightofeachstickareknowninadvance.Thesticksaretobeprocessedbyawoodworkingm
hechenghai
·
2011-09-20 20:00
joj
2487
2487:CentralAvenueRoadResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s65536K743169StandardTherearealotoftreesintheparkofJilinUniversity.Wewanttoopenuparoadinthisforestinastraightlinefromonetreetoanot
hechenghai
·
2011-09-18 18:00
tree
input
each
reference
output
distance
joj
1131 Intersection
一道wa了n+1次的题,都快绝望了,本想求助于网络上的各种代码,却发现一律模板,话说我现在还不知道模板为何物。。。。。。。终于在我的绞尽脑汁之下找到了错误,心情very舒畅,方法是看直线和矩形的各个边能不能相交(规范和非规范)以及他会不会在矩形里边:#include#includeusingnamespacestd;structpoint{ intx; inty;};intdet(inta
qiankun1993
·
2011-09-18 16:00
c
网络
joj
1611
1611:PerfectCubesResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K763314StandardForhundredsofyearsFermat'sLastTheorem,whichstatedsimplythatfor n >2thereexistnointegers a, b, c >1suchthat ,hasrem
hechenghai
·
2011-09-16 22:00
c
output
Numbers
joj
1873
1873:PowerStringsResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE10s8192K640254StandardGiventwostrings a and b wedefine a*b tobetheirconcatenation.Forexample,if a="abc"and b="def" then a*b="abcdef".Ifw
hechenghai
·
2011-09-16 22:00
joj
1466
1466:TheHammingDistanceProblemResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K417202StandardTheHammingdistancebetweentwostringsofbits(binaryintegers)isthenumberofcorrespondingbitpositionsthatdif
hechenghai
·
2011-09-16 20:00
joj
1169
这道题着实让我蛋疼了一下,看完书上的代码之后信心满满还稍微修改了一下方法来做这道题,结果wa的暗无天日,后来猛然想到oj的测试数据不一定一半是零,然后感觉样例输入果然很坑人,然后AC: #include#include#includeusingnamespacestd;intcap[32][32];intflow[32][32];inta[32];intp[32];intmain(){ in
qiankun1993
·
2011-09-16 20:00
测试
joj
1018
1018:AnagramsbyStackResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE5s8192K1175519StandardHowcananagramsresultfromsequencesofstackoperations?TherearetwosequencesofstackoperatorswhichcanconvertTROTtoTOR
hechenghai
·
2011-09-14 20:00
joj
1091
1091:P,MTHBGWBResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K328208StandardMorsecoderepresentscharactersasvariablelengthsequencesofdotsanddashes.Inpractice,charactersinamessagearedelimitedbysho
hechenghai
·
2011-09-14 20:00
joj
1141
1141:RailsResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K867302StandardThereisafamousrailwaystationinPopPushCity.Countrythereisincrediblyhilly.Thestationwasbuiltinlastcentury.Unfortunately,fund
hechenghai
·
2011-09-14 18:00
上一页
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
其他