![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
POJ
文章平均质量分 72
PrConstantin
BLOG: http://constantin.cc
GITHUB: https://github.com/uselessaddress
展开
-
(解题报告)POJ1969--Count on Canton(利用蛇形矩阵知识)
Count on Canton Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu SubmitStatus Description One of the famous proofs of modern mathematics is Georg Cantor’s demonstration th原创 2015-11-14 00:32:30 · 855 阅读 · 0 评论 -
(解题报告)POJ3664---Election Time---用结构体实现两组相关联数据的排序问题
两次快排 Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatus Description The cows are having their first election after overthrowing the tyrannical Farmer John, an原创 2015-11-22 23:36:02 · 713 阅读 · 0 评论 -
快速排序浅谈——(解题报告)HDU1157和POJ2388---Who's in the Middle
快速排序(快排)作为排序算法中较为常用和重要的一种,有其重要的地位,但初学可能有些晦涩,本文将较为详细的结合Who’s in the Middle这道题来讲讲快速排序的奥秘!首先是快排的简单介绍,它是由冒泡排序改进而来,基本思想是:(百科)通过一趟排序将要排序的数据分割成独立的两部分,其中一部分的所有数据都比另外一部分的所有数据都要小,然后再按此方法对这两部分数据分别进行快速排序,整个排序过程可以递原创 2015-11-21 00:34:38 · 661 阅读 · 0 评论 -
POJ3664---没使用结构体,用数组(未AC)
正如标题中所说,这个题在我用结构体做之前还尝试过使用数组,虽然自己的测试正确,但还是没有AC,我在这里也一并发出,希望有高人指点,我自己也会慢慢改动,直至AC! 下面是具体代码:#include <stdio.h>#include <string.h>void qsort(double *a,int l,int r) { int key=a[l],i=l,j=r; if(l>=原创 2015-11-23 00:39:23 · 324 阅读 · 0 评论 -
归并排序与逆序对问题---(解题报告)POJ1804---Brainman
归并排序,主要是以分治思想进行组合排序,先分再和,在和的过程中排序,排序的思路如下:先给你两组同向有序数组,首先判断两组数的首位的大小,并将较小的数保留到一个新数组中,接下来再比较较小组数的第二位和另一组数的第一位,仍然保留较小的数,这样就保证新数组的有序,需要注意的是当任意一组数为空时,就自然将另一组数的剩下数接到新数组后,至于为何,相信很好理解;(具体代码见下方/(ㄒoㄒ)/~~)逆序对,逆序对原创 2015-11-29 18:00:51 · 2269 阅读 · 0 评论 -
POJ2251---Dungeon Master---BFS最短路之三维迷宫
题目链接:http://poj.org/problem?id=2251 题目大意:这个题是BFS的典型模板题,只不过有趣的是它将图形由平面变为了三维立体图形, 自认为难点在输入上,采用三维字符数组,三层循环,最外层循环对应三维数组的第三维表示的就是层数。 具体代码如下:#include <iostream> #include <queue> #include <cstring> #includ原创 2016-04-20 01:06:01 · 500 阅读 · 0 评论 -
最小生成树之Prim算法---POJ1258---Agri-Net
题目链接:http://poj.org/problem?id=1258最小生成树的模板题/(ㄒoㄒ)/~~#include <iostream> #include <cstdio> #include <cstring> using namespace std; const int N=110; int map[N][N]; int vis[N]; int low[N]; int T; int pos原创 2016-04-20 20:24:28 · 453 阅读 · 0 评论 -
最小生成树之Kruskal---POJ1258---Agri-Net
题目链接:http://poj.org/problem?id=1258最小生成树的模板题/(ㄒoㄒ)/~~代码如下:#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <cstring> using namespace std; int pre[110]; int T; int f原创 2016-04-20 20:30:54 · 558 阅读 · 0 评论