Insertion Sort is a simple sorting technique which was covered in previous challenges. Sometimes, arrays may be too large for us to wait around for in...
分类:
其他好文 时间:
2014-08-12 18:13:14
阅读次数:
404
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4174
考虑第i个人当裁判的情形。假设从a1到ai-1有ci个人比ai小,那么就有(i-1)-ci个比ai大。di同理。
根据乘法原理和加法原理,i当裁判时有ci(n-i-di)+di(...
分类:
其他好文 时间:
2014-08-12 13:45:44
阅读次数:
193
Minimum Inversion Number
Time Limit: 2000/1000 MS (Java/Others) Memory Limit:
65536/32768 K (Java/Others)
Problem D...
分类:
其他好文 时间:
2014-08-12 09:04:33
阅读次数:
264
题意:求逆序对解题思路:1)树状数组 + 离散化解题代码: 1 // File Name: a.cpp 2 // Author: darkdream 3 // Created Time: 2014年08月05日 星期二 12时05分09秒 4 5 #include 6 #include 7 #in....
分类:
其他好文 时间:
2014-08-12 08:57:23
阅读次数:
182
DescriptionYou are given n points and two circles. The radius of the circle will be dynamical. Your task is to find how many points are under both cir...
分类:
其他好文 时间:
2014-08-12 02:57:33
阅读次数:
276
求有序数列的排列数如{1,2,3,4,5}的排序数目{1},{2},{3},{4},{5},{1,2},{1,3},{1,4}......代码:#include #include #include #include using namespace std;struct node{ int val, ...
分类:
其他好文 时间:
2014-08-11 20:38:42
阅读次数:
184
题目链接 : http://acm.hdu.edu.cn/showproblem.php?pid=1166敌兵布阵Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submissi...
分类:
其他好文 时间:
2014-08-11 10:04:52
阅读次数:
316
树状数组套主席树,维护区间动态第K大。。。
ZOJ给的空间太小,而主席树要求的空间太大,只能到BZOJ上交
1901: Zju2112 Dynamic Rankings
Time Limit: 10 Sec Memory Limit: 128 MB
Submit: 4186 Solved: 1754
[Submit][Status]
Description
给定一个含...
分类:
其他好文 时间:
2014-08-11 00:29:21
阅读次数:
313
解题报告
题意:
求逆序数。
思路:
线段树离散化处理。
#include
#include
#include
#include
#define LL long long
using namespace std;
LL sum[2001000],num[501000],_hash[501000];
void push_up(int rt)
{
sum[rt]=sum[rt...
分类:
其他好文 时间:
2014-08-11 00:22:01
阅读次数:
255
http://blog.csdn.net/shahdza/article/details/6314818
分类:
其他好文 时间:
2014-08-10 21:08:10
阅读次数:
265