这个题目好果的01,只要把每个数乘以100,就能解决下标的问题了
继续贴代码环节(自己的代码好丑啊~~~)
#include
#include
#include
#include
#define maxn 3100000
using namespace std;
int dp[maxn];
int p[31];
int main()
{
double Q;
int n,...
分类:
其他好文 时间:
2014-07-22 00:32:35
阅读次数:
213
冒泡排序代码:
#include
#include
using namespace std;
template
void bubbleSort(ItemType theArray[], int n)
{
bool sorted = false; // False when swaps occur
int pass = 1;
while (!sorted && (pass...
分类:
其他好文 时间:
2014-07-22 00:32:35
阅读次数:
363
唔。。弱弱的暴力水果
0操作时,将v加到u上,可以直接把v加到u相连的点上,这样输出时直接输出要求点的值。
布这样的话反正我是超时了。。
#include
#include
#include
#include
#include
#include
#include
const int maxn=100010;
using namespace std;
vector e[maxn]...
分类:
其他好文 时间:
2014-07-22 00:31:39
阅读次数:
204
The Dole Queue
Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld
& %llu
Submit Status
Description
The Dole Queue
In a serious attempt to downsi...
分类:
其他好文 时间:
2014-07-22 00:29:35
阅读次数:
287
stack
-------------------------------------------------------------
stack 是一种配接器(adapter),以某种容器作为底部结构,改变其接口,使之符合"先进后出"的特性。
SGI STL 默认以 deque 为 stack 底部结构
没有遍历行为,没有遍历器
示例:
#include
#include
#include
#include
using names...
分类:
其他好文 时间:
2014-07-22 00:28:39
阅读次数:
212
题目要求要求在满足约束条件的情况下,使小的序号尽力靠前。
坑点就在这里,小的序号尽量靠前并不是代表字典序,它要求多种情况时,先使1靠前(可能1只能在第2或第3位 那么就要使它在第2位),其次2,3。。而不是在当前情况下,该位最小是哪个就输出哪个
所以直接拓扑排序,或者优先队列都是错的,因为这样都只能保证字典序最小。可以参考代码后面的样例理解
正确做法应该是 反向建图后,用最大值优先的优先队列...
分类:
其他好文 时间:
2014-07-22 00:28:38
阅读次数:
210
贪心加树状数组
给出的数据可能出现两种情况,包含与不包含,但我们从右向左删就能避免这个问题;
#include
#include
#include
using namespace std;
const int maxn=200010;
int f[maxn],l[maxn],a[maxn];
long long tree[maxn];
int n;
inline int lowbit(int ...
分类:
其他好文 时间:
2014-07-22 00:27:36
阅读次数:
210
题意就是一颗星星的左下方有多少颗星星就是几级;
把每级的星星个数统计好输出就ok;
但不能用二维树状数组,会超内存,,
#include
#include
#include
#define maxn 32001
using namespace std;
int a;
int arr[maxn];
int low(int x)
{
return x&(-x);
}
void u...
分类:
其他好文 时间:
2014-07-21 13:38:26
阅读次数:
213
#include
#include
#include
#include
#include
using namespace std;
int h[20][20];
int v[20][20];
int size_[20];
int n,m;
int flag;
void judge(int x,int y)//这是关键部分的代码,用来判读那是否能构成square;
{
int a1=n-x...
分类:
其他好文 时间:
2014-07-21 13:36:09
阅读次数:
221
0. java学习必看,你的大方向http://java.itcast.cn/subject/hadoop2/index.shtml?140701lcqqq1
1、JDK6中文API:http://tool.oschina.net/apidocs/apidoc?api=jdk-zh
2、Netty4.x用户向导:http://netty.io/wiki/user-guide-for-4.x....
分类:
编程语言 时间:
2014-07-21 13:35:49
阅读次数:
234