自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 资源 (1)
  • 收藏
  • 关注

原创 POJ 1423 解题报告

这道题不能硬算。有很多巧妙的解法。其一是打表“硬算”,但是当大于10, 100, 1000,...,等时除以相应的10的倍数(比如大于100时除以10),这样也能统计出来位数。解法见:http://poj.org/showmessage?message_id=173590其二是用stirling's approximation: http://en.wikipedia.org/wiki

2015-05-30 04:58:25 325

原创 POJ 1018 解题报告

这道稀里糊涂就过了。算是很顺利。想法也很朴素。对每个设备按照制造商的带宽从大到小排序。这时可以除去那些带宽低但是价格高的制造商。比如(80, 25)和(120, 80)。然后采用类似归并排序的方法。1. 初始化所有设备的制造商指针都指向第一个制造商,2. 确定最小的带宽,更新其他设备的制造商指针(其他设备可能有比这个最小带宽大的制造商)。着这个过程中可以确定在当前最小带宽下,每个设

2015-05-30 02:10:00 777

原创 POJ 3349 解题报告

这道题我用的是hash。之前用map TLE了。看discuss发现得用hash。事实是hash要比map快很多。这里的hash用的是最简单的求和再对一个大prime(999331)取余。另外用到了数组形式的链表。用一个next数组保存下一个同hash的snowflake的位置。要对同hash的所有snowflake按照链表一一判断是否相同。这里判断就是老老实实地对不同起点进行遍历,每

2015-05-29 13:32:24 439

原创 POJ 1657 解题报告

BFS简单题。thestoryofsnow1657Accepted156K0MSC++3173B/* ID: thestor1 LANG: C++ TASK: poj1657 */#include #include #include #include #include #include #include #incl

2015-05-28 07:51:30 770

原创 POJ 3469 解题报告

这道题大家的做法都是最小割,构图也一样:对每个点,从source加一条capacity为Ai的边,再加一条从该边到sink的capacity为Bi的边。对需要data exchange的点,增加一条capacity为m的双向边。至于为什么这样构图,discuss里面有些说明。当然,我也不是特别清楚原理。由于最小割就是最大流,所以就转化为考验最大流标程效率的问题。我之前的Edmonds-Karp

2015-05-27 03:53:38 460

原创 POJ 2136 解题报告

简单题。thestoryofsnow2136Accepted132K0MSC++1137B/* ID: thestor1 LANG: C++ TASK: poj2136 */#include #include #include #include #include #include #include #include

2015-05-17 02:44:42 385

原创 POJ 3062 解题报告

不是题。。。thestoryofsnow3062Accepted132K0MSC++521B/* ID: thestor1 LANG: C++ TASK: poj3062 */#include #include #include #include #include #include #include #includ

2015-05-16 05:54:51 524

原创 POJ 1519 解题报告

简单题。需要注意的是最开始的输入可能会很大,因而不能假设为整形。当然sum一下就是整形了。thestoryofsnow1519Accepted148K0MSC++1088B/* ID: thestor1 LANG: C++ TASK: poj1519 */#include #include #include #includ

2015-05-16 05:39:50 586

原创 POJ 1579 解题报告

简单题thestoryofsnow1579Accepted184K0MSC++1247B/* ID: thestor1 LANG: C++ TASK: poj1579 */#include #include #include #include #include #include #include #include

2015-05-16 05:11:32 457

原创 POJ 1504 解题报告

简单题。thestoryofsnow1504Accepted136K16MSC++693B/* ID: thestor1 LANG: C++ TASK: poj1504 */#include #include #include #include #include #include #include #include

2015-05-16 01:23:55 550

原创 POJ 1157 解题报告

这道题是DP题。应该能够自己发现的。结果还是先看了discuss,发现是比较简单的DP后做的。定义DP[i][j]为把花i放在瓶j(包括j)之后的情况从i(包括i)之后的所有花能得到的最大值。填充DP, 然后返回DP[0][0]就好。做法是把花从后往前遍历,花瓶也从后往前遍历,且只考虑可能的花瓶(太后或太前会导致其他花没地方放)。DP[i][j] = max(A[i][j] + D

2015-05-16 00:57:30 394

原创 POJ 3030 解题报告

简单题。thestoryofsnow3030Accepted132K0MSC++682B/* ID: thestor1 LANG: C++ TASK: poj3030 */#include #include #include #include #include #include #include #include

2015-05-14 01:04:49 611

原创 POJ 3041 解题报告

这道题其实是求最小覆盖点。如果(r, c)处存在一点,则在(左边)r 和 (右边)c之间连一条线。选取r或者c中的任意一点,则“覆盖”这条边。问题是求覆盖掉所有边的最小点集是多少。而最小点集的大小等于二分图最大匹配的数目。由如上转换后这道题就成了最大二分匹配题目,可以直接用之前1274的代码。思路见:http://poj.org/showmessage?message_id=164158

2015-05-14 00:58:18 583

原创 POJ 2301 解题报告

简单题。thestoryofsnow2301Accepted132K0MSC++706B/* ID: thestor1 LANG: C++ TASK: poj2301 */#include #include #include #include #include #include #include #include

2015-05-13 01:08:45 618

原创 POJ 1274 解题报告

这道题是在USACO上面做过的。当时用的是maximum flow。在这里就超时了。一个原因是usaco上面是单case,这里是多case,所以数组之类的应该重用。但主要原因还是这个是个最大二分匹配的问题,maxflow overkill了,过于重型。似乎最大二分匹配算法又叫做匈牙利算法。geeksforgeeks上面有非常清晰的解释,本质上就是跑dfs。具体见:http://www.ge

2015-05-13 00:58:49 314

原创 POJ 2253 解题报告

看了discuss,这道题似乎用很多方法都能accept:多源最短路径(Floyd),单源最短路径(Dijkstra, SPFA),或最小生成树(prime)。我这里用的是spfa,稍稍改变下条件:if (max(jump[u], weight[u][v]) 即更新从源到任意点的最大jump(即路径中的一跳)中的最小值。thestoryofsnow2253

2015-05-12 07:54:46 340

原创 POJ 2390 解题报告

这道题是道简单题,当然,手写pow会增加难度,看自己的选择了。我这里直接用的cmath里面的pow。thestoryofsnow2390Accepted144K0MSC++488B/* ID: thestor1 LANG: C++ TASK: poj2390 */#include #include #include #in

2015-05-11 23:42:07 708

原创 POJ 1042 解题报告

这道题最好的解释在这里:http://blog.csdn.net/ju136/article/details/6957771这里不再赘述。总之就是贪心加枚举。对于“Each 5 minutes of fishing decreases the number of fish expected to be caught in the next 5-minute interval” 这句话的理解

2015-05-11 23:30:06 552

原创 POJ 1083 解题报告

这道题看着很难,看了discuss上面的这个这个讨论:http://poj.org/showmessage?message_id=123867后发现其实挺简单的。解法在上述链接中。thestoryofsnow1083Accepted152K0MSC++962B/* ID: thestor1 LANG: C++ TAS

2015-05-06 08:34:40 456

原创 POJ 1160 Solution Report

I actually do not why it is accepted. It seems to be a straightforward Dynamic Programming Problem, but the 'optimal substructure' is hard to understand.You can refer to others' posts, as the soluti

2015-05-05 05:43:01 523

原创 POJ 2187 解题报告

Summited this problem for 10 time. The last two are successful. I guess the problem is that I am not that familiar with either convex_hull or rotating_calipers.It turns out that `convex_hull` return

2015-05-02 02:39:54 366

Nehe的OpenGL教程(PDF)

PDF格式的 讲解很详细 包括安装和一些常见问题的解答 共38课

2010-03-05

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除