![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
排序
文章平均质量分 58
yangshuolll
这个作者很懒,什么都没留下…
展开
-
hdu diy Developing School's Contest 2012-6 by SYU 优先队列排序问题
E.Container Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other) Total Submission(s) : 66 Accepted Submission(s) : 33 Font: Times New Roman | Verdana | Georgia原创 2012-08-18 11:38:47 · 1109 阅读 · 0 评论 -
排序算法和查找 例子详解
选择排序#include void select_sort(int data[],int size){ int i,j; for (i = 1;i < size; ++i){ int pos = i - 1; for(j = i - 1; j < size; ++j){ if(data[pos] > data[j]){ pos = j原创 2014-03-30 14:11:38 · 972 阅读 · 0 评论 -
poj 3481 Double Queue 排序
Double Queue 方法一 直接调用 用 O(n)的查询来找最小值也可以 方法二 然后用set 也可以进行排序 两种方式 #include #include #include using namespace std; struct node{ int num,pro; bool operator <(const node &a)const{ re原创 2013-08-28 22:37:57 · 1146 阅读 · 0 评论 -
UVA 11292 - Dragon of Loowater 排序问题
题目链接 题意就是每个勇士有个能力值,恶龙有多个头,一个勇士的能力值要大于恶龙的一个头的能力值,就可以将一个头砍掉,一个勇士只能用一次,雇佣的价格等于勇士的能力值,问是否能将恶龙的头全部砍掉,若能输出最小花费。 算法: 对勇士能力值从小到大排序,对恶龙的能力值排序,然后一一比对就可以了。 post code: #include #include #include using namespa原创 2013-04-05 23:25:35 · 814 阅读 · 0 评论 -
codeforces 282B - Painting Eggs
B. Painting Eggs time limit per test 5 seconds memory limit per test 256 megabytes input standard input output standard output The Bitlandians are quite weird people. Th原创 2013-03-14 23:50:10 · 1604 阅读 · 4 评论 -
codeforces 265C - Escape from Stones 思维问题
C. Escape from Stones time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Squirrel Liss lived in a forest peace原创 2013-01-30 22:46:29 · 1577 阅读 · 1 评论 -
poj 1928 peanuts 排序
The Peanuts Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 6863 Accepted: 2834 Description Mr. Robinson and his pet monkey Dodo love peanuts very much.原创 2012-10-25 19:57:09 · 818 阅读 · 0 评论 -
poj 1833 排列 库函数 next_permutation 的调用
排列 Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 13121 Accepted: 5442 Description 题目描述: 大家知道,给出正整数n,则1到n这n个数可以构成n!种排列,把这些排列按照从小到大的顺序(字典顺序)列出,如n=3时,列出原创 2012-10-06 14:11:21 · 1004 阅读 · 0 评论 -
hdu 2115 I Love This Game 典型的结构体排序
I Love This Game Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3740 Accepted Submission(s): 1286 Problem Description Do you li原创 2012-10-02 14:23:36 · 1183 阅读 · 0 评论 -
QuickSort
QuickSort 示例quicksort 使用了递归二分的思想,首先找到最初的基准数(以第一个为基准),如果从小到大的排列的话,先在右边找到比基准数小的数组下标,然后再在左边找到比基准数大的数组下标,两个数交换位置。 如果左边的基准数下标等于右边的基准数下标。下标表示的数和最初的基准数交换位置。 然后左边的数组和右边的数组还是按照这个方法继续排序下去。#include<stdio.h> void原创 2017-12-18 23:29:08 · 259 阅读 · 0 评论