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
2727: GRE(混合欧拉路)
算法基本和Sightseeingtour一样,但是要注意判断图的连通性,而且要放宽判断条件,存在2个度为奇的点时,则要添加一条边构成回路普通EK算法#include #include #include #include #include #definemin(a,b)((a)>(b))?(b):(a) usingnamespacestd; constintmaxn=30; constintI
jxy859
·
2011-07-23 14:00
JOJ
2414 && POJ 1637 Sightseeing tour(混合欧拉回路)
用的邻接阵的最一般的方法EK算法跑了0.22s是
JOJ
最慢的。。。#include#include#definemin(a,b)((a)>(b))?
jxy859
·
2011-07-22 23:00
JOJ
2645 Working in JLU (任务调度 贪心算法 并查集 )
实验题目:用贪心算法解决作业调度问题。实验目的:1. 学习带时限的作业调度—最大时限选择方法。2. 掌握贪心算法的应用。问题描述:给定任务序列J1J2...Jn,假定只有一台处理机为这批作业服务。每件任务Ji给定一个时限di和对应利润Pi。只有在规定时限之内完成作业,才会得到利润Pi。通过设计合适的算法选择和安排任务子集Ji,使得J中的每个作业都能在各自的时限内完工,且使获得的利
jxy859
·
2011-07-18 20:00
生成函数(待补充……)
整理一下以前做过的生成函数的题
JOJ
1026 TheStaircases构造函数(1+x)(1+x^2)(1+x^3)(1+x^4)……答案为d[n]-1减去的是step为1的情况#include#includeconstintmaxn
jxy859
·
2011-07-11 13:00
joj
1509Hamiltonian Cycle (dfs求H回路)
利用了Hamiltonian路的一些性质#include#include#include//practiceforhamiltongraphanddfs.usingnamespacestd;constintmaxn=1000;boolmap[maxn][maxn];intpath[maxn];boolvis[maxn];intn,edge;boolflag;voiddfs(intx,intcnt
jxy859
·
2011-07-11 10:00
c
Graph
Path
n2
JOJ
1170: Wire Is So Expensive (MST kruskal 无合并)
赤裸裸的最小生成树问题。。。#include#includeusingnamespacestd;constintmaxn=400;inti,n;inte_u[maxn],e_v[maxn],w[maxn],p[30],rank[maxn];intcmp(const int&i,constint&j)//按权值大小给边排序{ returnw[i]
jxy859
·
2011-07-09 14:00
JOJ
1089 & ZOJ 1060 & poj 1094 Sorting It All Out (邻接表的栈拓扑排序模板)
DescriptionAnascendingsortedsequenceofdistinctvaluesisoneinwhichsomeformofaless-thanoperatorisusedtoordertheelementsfromsmallesttolargest.Forexample,thesortedsequenceA,B,C,DimpliesthatA#includeconstin
jxy859
·
2011-07-08 20:00
list
struct
null
input
character
sorting
joj
1023: Digital Roots(WS超短)
很水的高精度题,只是别人问的时候,突然想把自己10几行的代码改进 #include charn[300]; intmain() { while(scanf("%s",n)!=EOF&&n[0]-48) { intm,i; for(m=0,i=0;n[i]!='\0';m+=n[i]-48,++i); printf("%d\n",m%9?m%9:9); } return0; }
jxy859
·
2011-07-05 20:00
joj
1131: Intersection (判断直线与矩形是否有交点)
Youaretowriteaprogramthathastodecidewhetheragivenlinesegmentintersectsagivenrectangle.Thelineissaidtointersecttherectangleifthelineandtherectanglehaveatleastonepointincommon.Therectangleconsistsoffou
jxy859
·
2011-07-04 16:00
joj
2657 简单贪心
/* Name:
joj
2657打水问题 Author:UnimenSun Date:4/07/1121:54 Description:简单贪心 */ #include #include #include
Unimen
·
2011-07-04 14:00
joj
1085: I Think I Need a Houseboat 半圆形侵蚀
1085:IThinkINeedaHouseboatResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K1364522StandardFredMapperisconsideringpurchasingsomelandinLouisianatobuildhishouseon.Intheprocessofinvestigatingtheland,h
jackchen0227
·
2011-06-24 20:00
REST
F#
joj
1032 deck 重心的计算
1032:DeckResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE15s8192K1819601StandardScenarioAsingleplayingcardcanbeplacedonatable,carefully,sothattheshortedgesofthecardareparalleltothetable'sedge,andhalfthe
jackchen0227
·
2011-06-24 19:00
计算
joj
1186 Box of Bricks 水题
1186:BoxofBricksResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE1s8192K1047437StandardLittleBoblikesplayingwithhisboxofbricks.Heputsthebricksoneuponanotherandbuildsstacksofdifferentheight.``Look,I'vebu
jackchen0227
·
2011-06-19 09:00
J#
***
joj
1026 the staircase 利用递归、动态规划和一道类似题目
转自网易何国涛的博客http://zhedahht.blog.163.com/blog/static/25411174200732711051101/ 题目:输入一个正数n,输出所有和为n连续正数序列。 例如输入15,由于1+2+3+4+5=4+5+6=7+8=15,所以输出3个连续序列1-5、4-6和7-8。 分析:这是网易的一道面试题。
jackchen0227
·
2011-06-18 19:00
面试
Blog
F#
J#
joj
1062 Computer Versus Mankind 非递归最大公约数 最小公倍数
1062:ComputerVersusMankindResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K24371119StandardMikeisafanonprogramming.He'ssurethatcomputercandoeverythingfasterthanmankinddoesifakindoftaskisrepeatedc
jackchen0227
·
2011-06-18 15:00
com
joj
1817: Triangle 三角形的判定
1817:TriangleResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE5s8192K2409685Standard2nd JOJCupOnlineVContestProblemGiventhreeintegersa,bandc(|a|,|b|,|c| usingnamespacestd; inta,b,c,tmp; intmain() {
jackchen0227
·
2011-06-15 20:00
C++
c
C#
joj
1817: Triangle 三角形的判定
阅读更多1817:TriangleResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE5s8192K2409685Standard2ndJOJCupOnlineVContestProblemGiventhreeintegersa,bandc(|a|,|b|,|c|usingnamespacestd;inta,b,c,tmp;intmain(){intcoun
jackchen0227
·
2011-06-15 20:00
C
C++
C#
×
joj
1175 The Binomial Function 递归,递归优化,非递归
1175:TheBinomialFunctionResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K2698800Standard1stJilinUniversityACMInternationalCollegiateProgrammingContestInthisproblem,youaretowriteaprogramtomakethev
jackchen0227
·
2011-06-15 19:00
J#
joj
1146 标准输入+字符串反转
1146:WordReversalResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K2445640StandardForeachlistofwords,outputalinewitheachwordreversedwithoutchangingtheorderofthewords.Thisproblemcontainsmultipletest
jackchen0227
·
2011-06-15 18:00
算法
J#
joj
1149Binary Number 二进制移位操作
1149:BinaryNumbersResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K1690653StandardGivenapositiveintegern,ndthepositionsofall1'sinitsbinaryrepresentation.Thepositionoftheleastsignificantbitis0. Exa
jackchen0227
·
2011-06-15 09:00
J#
joj
2484
2484:ChineseCharacterArtResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s65536K1322473StandardChinesecharactersisawonderfulgraphic.ManyforeignerswriteChinesecharactersonhisT-shirt.YoucandrawaspecialChi
jackchen0227
·
2011-06-14 13:00
J#
**
joj
:1017 fire net 递归回溯的使用
1017:FireNetResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K1086565StandardSupposethatwehaveasquarecitywithstraightstreets.Amapofacityisasquareboardwithnrowsandncolumns,eachrepresentingastreetor
jackchen0227
·
2011-06-14 12:00
.net
F#
J#
joj
1014 the matrix 从八个方向遍历访问矩阵
1014:TheMatrixResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K2109670StandardGivenamatrixofcharacters,andalistofwords,outputwhetherornoteachwordispresentinthematrix.Wordsmayappearforwardsandbac
jackchen0227
·
2011-06-10 20:00
apple
J#
joj
1013 Polynomial Multiplication多项式乘法的计算
1013:PolynomialMultiplicationResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K4373753StandardApolynomialisasumofterms,whereeachtermisacoefficientmultipliedbythevariablexraisedtosomenonnegativeint
jackchen0227
·
2011-06-10 19:00
J#
joj
2749 大数比较大小与减法
/* 题目不难,一个大数减法,一个大数的比较,关键是边界条件的检查 */ #include #include #include intcode[10]={0,1,2,-1,-1,5,9,-1,8,6};//这个是0-9旋转之后的数字,-1表示旋转之后出错 /* 大数的减法 */ voidminus(chars[1000],chars1[1000]) { intk=0; f
jackchen0227
·
2011-06-08 16:00
C++
c
C#
J#
**
joj
1903 tug of war 使用动态规划
1903:TugofWarResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE15s8192K556123StandardAtugofwaristobearrangedatthelocalofficepicnic.Forthetugofwar,thepicnickersmustbedividedintotwoteams.Eachpersonmustbeon
jackchen0227
·
2011-06-07 10:00
J#
Office
吉林大学acm在线评判系统的关键技术
随着将
JOJ
的footer版本号改为Version3.01,终于可以长出一口气。持续一个多月的
JOJ
网站升级已经基本完成。
Warlock_坏坏
·
2011-06-05 20:00
PHP
linux
mysql
Ajax
redhat
joj
:1011 If only I had a Venn diagram--求集合的差集
1011:IfonlyIhadaVenndiagramResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s524288K38421528StandardThesymmetricdifferenceoftwosetsisthesetofelementsbelongingtoonebutnotbothofthetwosets.Forexample,ifweh
jackchen0227
·
2011-05-30 17:00
J#
UP
joj
:1009 Zorro
#include <stdio.h> void printZorro(int n) { int i; char alph[26]; for(int k=0;k<26;k++) { alph[k] = (char )('a' + k); } for(i = 0;i<n;i++) printf("%c"
jackchen0227
·
2011-05-30 17:00
C++
c
算法
C#
vc++
joj
:1011: If only I had a Venn diagram差集的计算
#include <stdio.h> int a[100]; int b[100]; int res[100]; /* 选择排序 */ void sortBySelect2(int *array,int len) { for(int i=0;i<len - 1;i++) { int t = 0; int tmp; for(int j=i;
jackchen0227
·
2011-05-20 21:00
J#
joj
1006 十进制转换成base进制
#include <stdio.h> #include <string.h> int a[20]; int b[20]; //将十进制数转化成 base进制 void baseConvert(int num,int * array,int base) { int i = 0; while(num) { array[i] = num % base
jackchen0227
·
2011-05-19 19:00
进制转换
JOJ
:1012
水题 为了复习下c的最基本 //
joj
提示runtime error???
jackchen0227
·
2011-05-09 19:00
C++
c
C#
joj
2526: medic(dp 背包 )
01背包#include#include#includeusingnamespacestd;constint maxn=105;intmain(){ inti,j,T,M,f[10000],t[maxn],v[maxn]; while(cin>>T>>M) { for(i=1;i>t[i]>>v[i]; } memset(f,0,sizeof(f)); for(i=1;i=0;j--)
jxy859
·
2011-05-05 23:00
joj
1016: Degrees of separation(单词当点的最短路)
ResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K1154477StandardFindouthowmanypeopleseparateonepersonfromanother.Thenumberofpeoplewillbenomorethan20.Input Apositiveintegerrepresentingthenumberofpe
jxy859
·
2011-05-04 15:00
joj
1002: Stockbroker Grapevine(最短路floyd)
//我做的第一道正规的图论题。题目很长,大概意思就是谣言由1点可以同时通过边传到多个点花费的时间是每边的权值,要求从开始给第一个传谣言到所有人都被传到,花费时间最少的情况的总时间和要传给谁,如果图不是连通的要printf("disjoint/n")//主要思路是floyd求出所有点间的最短路,在以其中一点为起点保存其到其他点的最大路径(前提是所有路径存在),找这样的最大路径最少的点和时间#incl
jxy859
·
2011-04-30 20:00
JOJ
上的典型题目分类以及参考书目 (以及我的整理)
基本算法1,高精度计算.计算任意长位数的两数加减乘除四则运算.参考书目:《国际大学生程序设计竞赛辅导教程》,郭嵩山,北京大学出版社典型例题:10041386192019492,数论算法.用欧几里得算法求两整数的GCD,LCM;求解模线性方程;中国余数定理;质因数分解等.参考书目:《实用算法的分析与程序设计》,吴文虎,清华大学出版社典型例题:1019(what?)10271062(水水更健康) 11
jxy859
·
2011-04-30 18:00
joj
2223: A Bug's Life (ws版的并查集)
ResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE10s8192K544115StandardBackgroundProfessorHopperisresearchingthesexualbehaviorofararespeciesofbugs.Heassumesthattheyfeaturetwodifferentgendersandthattheyon
jxy859
·
2011-04-22 21:00
input
each
merge
bugs
behavior
Numbers
joj
2431: Shift and Increment (模板队列与数组模拟队列的对比练习)
ResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE5s16384K1226196StandardShiftandincrementisthebasicoperationsoftheALU(ArithmeticLogicalUnit)inCPU.Onenumbercanbetransformtoanyothernumberbytheseoperations.
jxy859
·
2011-04-22 20:00
joj
1839: Arctan
ResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE5s8192K26242StandardArctanfunctioncanexpandtoaninfiniteprogression:Peopleoftencaculatepiusingarctanfunctions.Forexample,theeasiestwaytocalculateπis:howeve
jxy859
·
2011-04-21 22:00
joj
2243: Endless Carry (水题,献给位运算)
ResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K810293Standard作为2进制的加法,从k加1变成k+1可能会出现若干进位。如1011加1就会有2个进位。给定n,从0开始不停地加1直到n,计算在此过程中总共会有多少次进位。Input输入的每一行有单独的一个值n。n=0标志输入结束Output对于输入的每一行,使用单独一行输出对应结果
jxy859
·
2011-04-19 15:00
joj
2077: In Danger (约瑟夫环+位运算初步)
ResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K12855StandardFlaviusJosephusand40fellowrebelsweretrappedbytheRomans.Hiscompanionspreferredsuicidetosurrender,sotheydecidedtoformacircleandtokilleve
jxy859
·
2011-04-18 21:00
joj
2569: Musical Chairs (约瑟夫环 数学方法非迭代)
为了讨论方便,先把问题稍微改变一下,并不影响原意:问题描述:n个人(编号0~(n-1)),从0开始报数,报到(m-1)的退出,剩下的人继续从0开始报数。求胜利者的编号。我们知道第一个人(编号一定是(m-1)%n)出列之后,剩下的n-1个人组成了一个新的约瑟夫环(以编号为k=m%n的人开始):kk+1k+2...n-2,n-1,0,1,2,...k-2并且从k开始报0。现在我们把他们的编号做一下转换
jxy859
·
2011-04-18 21:00
joj
2575: Moveable quadrangle with three edges ()
ResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K43575Standard我们知道,四边形是可以移动和不稳定的。给定三个相连的边a,b和c,它们之间的夹角可以活动,第四条边由两边的顶点虚拟连线构成,这个四边形的面积随不同的夹角变化。请找出最大的四边形面积。Input输入的每一行代表一个Case。每一行有三个正浮点数,分别是a,b,c。Out
jxy859
·
2011-04-15 21:00
[置顶]
joj
(神一般的循序渐进200题 扩充版 11.08.20)
在宋师兄的基础上,又加了一些算法的典型题。(有一些可能只有题号没有贴链接)Level0(试试吧,电脑判题很神奇的):AC掉 1000(TheA+BProblem) 吧!(一二阶段,共49题,每天至少三题,由简到难)Level1(格式入门,熟悉OJ):2484(格式控制) 2357(排序) 1012(数论,最大公约数)2153(人品题)
jxy859
·
2011-04-14 20:00
joj
1004: Octal Fractions
ResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K3686828StandardFractionsinoctal(base8)notationcanbeexpressedexactlyindecimalnotation.Forexample,0.75inoctalis0.963125(7/8+5/64)indecimal.Alloctalnu
jxy859
·
2011-04-13 20:00
joj
2330: Math
ResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE1s8192K39554StandardGivenanonnegativeintegera,andapositiveintegerN,wedefine:f(a,1)=af(a,k)=f(a,k–1)*f(a,k–1)%N,k>1Theremayormaynotexistsomepositiveinteger
jxy859
·
2011-04-11 23:00
joj
2296 Boxes
ResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K17842StandardNboxesarelinedupinasequence(1#include#includeusingnamespacestd;intmain(){ unsignedlonglong n,a,b;while(cin>>n>>a>>b){ unsigne
jxy859
·
2011-04-11 23:00
joj
2433: Circle Railway
ResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K454131StandardTherearesomevillagesintheACMMainland.Thekingwanttobuildacirclerailwaytomakethetrafficmoreeasy.Whatisthebestradiusifthecenterofthecirc
jxy859
·
2011-04-11 10:00
struct
input
Build
each
output
joj
2045: Mountains
2045:MountainsResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE1s8192K7937StandardAmountainconsistsofoneormorehills,eachofwhichconsistsofupwards,whichwedenotewith`/',anddownwards,whichwedenotewith'/'.Wec
hqd_acm
·
2011-03-27 20:00
joj
1857 Catenyms
1857:CatenymsResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K8417StandardAcatenymisapairofwordsseparatedbyaperiodsuchthatthelastletterofthefirstwordisthesameasthelastletterofthesecond.Forexample,
hqd_acm
·
2011-03-27 18:00
list
each
Dictionary
output
pair
Forms
上一页
2
3
4
5
6
7
8
9
下一页
按字母分类:
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
其他