各类比赛
文章平均质量分 83
talak
这个作者很懒,什么都没留下…
展开
-
astar 百度的新大厦
时间限制: 1000ms内存限制: 65536kB 描述 继百度搜索框大厦之后,百度又于2012年初在深圳奠基了新的百度国际大厦,作为未来百度国际化的桥头堡。不同于百度在北京的搜索框大厦,新的百度国际大厦是一栋高楼,有非常多的楼层,让每个楼中的电梯都能到达所有楼层将是一个极为不明智的设计。因此,设计师给出了一个特别的设计——一共大厦有m个电梯,每个电梯只有两个按钮,(针对第i个电梯)两个按钮分原创 2012-05-30 09:39:55 · 1437 阅读 · 0 评论 -
hdu 4282
http://acm.hdu.edu.cn/showproblem.php?pid=4282 太假了,看解题报告说居然只要讨论K==2和K>3就行了 2B了 贴下代码: #include #include #include #include #include #include #include #include #include using namespace s原创 2012-09-09 21:01:37 · 1092 阅读 · 0 评论 -
hdu 4279
http://acm.hdu.edu.cn/showproblem.php?pid=4279 按前n个数有多少个real number 打个小表 找规律,推公式 代码: #include #include #include #include #include #include #include #include #include using namespace std原创 2012-09-09 23:58:16 · 526 阅读 · 0 评论 -
the running man 【NOJ】
链接:http://acm.nbut.cn/Problem/view.xhtml?id=1137 很裸的最短路问题我用的floyd算法,可以用迪杰斯特拉,我这里只是想熟悉一下floyd 但不知怎么的赋值权值时候map[a][b]和map[b][a]不能算相等 难道不是无向图?? 我不清楚,你们谁来看看,解释下 #include #include #define maxn 9999原创 2012-05-30 01:06:38 · 857 阅读 · 0 评论 -
Base of Space NOJ
链接:http://acm.nbut.cn/Problem/view.xhtml?id=1129 入门级别的并查集 开始做这题的时候还是知道是求它是连通还是不连通,然后求其连通分支个数-1 可是不知道是并查集 所以用了讨巧的方法 用了性质 一个无向图 G=(V,E) 是连通的,那么边的数目大于等于顶点的数目减一:|E|>=|V|-1,而反之不成立。 没看到反之不成立的几个字 然后悲剧原创 2012-05-26 01:21:22 · 420 阅读 · 0 评论 -
chocolate buying
不想说了。。 int cmp() 中的函数是long long 型 我直接return 两数相减的值导致WA15次左右 - -! 贴代码作为教训,谨记在心。。。 #include #include #include #include struct noi { long long pi; long long ci; }a[100005]; int cmp(const原创 2012-07-16 12:01:43 · 444 阅读 · 0 评论 -
pills
2087 - Pills Accepted: 7 Submissions: 8 Time Limit: 1000 ms Memory Limit: 1048576 KB Aunt Lizzie takes half a pill of a certain medicine every day. She starts with a b原创 2012-08-12 23:09:05 · 621 阅读 · 0 评论 -
Elevator Trouble
Elevator Trouble You are on your way to your first job interview as a program tester, and you are already late. The interview is in a skyscraper and you are currently in floor s, where you see an ele原创 2012-08-14 12:36:22 · 636 阅读 · 0 评论 -
Robots on a grid
Robots on a grid Time Limit: 3000ms Memory Limit: 65536KB 64-bit integer IO format: %lld Java class name: Main PrevSubmit Status Statistics Discuss Next You have rece原创 2012-08-14 16:30:31 · 557 阅读 · 0 评论 -
Condorcet Winners
看大神的代码后才会做 打擂台相似的想法 #include #include #include #include #include #include #include #include using namespace std; int n,m; int people[512][2512]; int compare(int a,int b) { int c1=0;原创 2012-08-21 19:45:22 · 818 阅读 · 0 评论 -
bale share
2076 - Bale Share Accepted: 6 Submissions: 32 Time Limit: 1000 ms Memory Limit: 1048576 KB Problem 2: Bale Share [Fatih Gelgi, 2010] Farmer John has just received a原创 2012-08-23 13:33:46 · 724 阅读 · 0 评论 -
湘潭市比赛A题 Anti-Goldbach's Conjecture
链接:http://202.197.224.59/OnlineJudge2/index.php/Problem/read/id/1140 看到题目首先就想到打表,打表这个过程是没错,但是,打表后该怎么做了,这题目有点蛋疼,输出的时候 要输出的它前面的数包括他自己的总和,首先朴素的枚举他前面的所有答案,然后加起来,肯定会超时的。 这题可以打奇合数的表,可以打素数的表,可以找规律,每次方法对原创 2012-05-25 22:21:15 · 1301 阅读 · 1 评论 -
CSU 5月月赛B题
题目意思很简单,就是求三个串的最长公共子序列 刚开始理解错题目意思了,以为是字符串匹配,下次要注意了 后来就想到用DP了,可是这个是三个串的最长公共子序列 本菜只会二个串的,本想可不可以从两个串用类似的转移方程做三个串 但做出来是错的,本了下别的大神,据说我的方法没错 继续检查代码。。找了好久终于找出来了,原来是max函数写错了 贴一下max函数以此为鉴 int max(int a,原创 2012-05-25 22:33:10 · 1243 阅读 · 0 评论 -
zoj 3665
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4888 枚举圈数r,二分k 本来一直TLE,改成成%lld就过了,真奇葩 #include #include #include #include #include #include #include #include #include #include原创 2012-10-17 13:03:42 · 476 阅读 · 0 评论