自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

转载 归并排序求逆序数对。

1 #include <iostream> 2 #include <stdio.h> 3 #include <cstring> 4 #include <vector> 5 using namespace std; 6 int high[100010]; 7 int temp[100010]; 8 int...

2015-04-03 23:11:00 116

转载 Two Sum

struct node{ int n; int value;};bool cmp(node a,node b){ return a.value<b.value;}class Solution {public: vector<int> twoSum(vector<int> &n...

2014-11-07 23:20:00 117

转载 uva11100 贪心

#include <iostream>#include <stdio.h>#include <cstring>#include <vector>#include <algorithm>int Int[10010];int visit[100010];using namespace std;...

2014-10-31 13:32:00 136

转载 uva11134 贪心 回溯必tle 规模5000

行和列分别考虑,找出右端点中最靠左,左端点最靠右的,必然是最优方案#include<iostream>#include<vector>#include<stdio.h>#include<cstring>#include<algorithm>using namespace std;struct ...

2014-10-30 16:19:00 150

转载 LA 4254 这个为什么会超时?

#include<iostream>#include<vector>#include<stdio.h>#include<cstring>#include<algorithm>using namespace std;struct Line{ int a,b,w;};vector...

2014-10-26 21:05:00 105

转载 复习基础算法的感想

  晚上做杭电OJ,第二题是一个比较直观的题,我也是太直观了。贴出代码,供自己反省,从7点15分一直做到结束,wa9次。。。。orz。。。。看来自己的算法功底还差的很远很远。    接下的几天,学习大白上的基础算法部分。  #include<iostream>#include<stdio.h>#include<cstrin...

2014-10-25 21:08:00 106

转载 判断组合数C(N,K)的奇偶性

一、首先最直接的方法求组合数,判断,耗时太大。二、C(N,K)=N!/(K!(N-K)!);假设N!中2因子个数为a,K!中2因子个数为b,(N-K)!中2因子个数为c,则只需求出a,b,c;N!中,因子为i个数为N/i+N/i^2......+N/i^k (其中,i^k<N,i^(k+1)>=N);接下来若a>b+c,则组合数位奇数,a=b+c,组合数为偶...

2014-10-24 23:51:00 550

转载 uva11039

很2b的排序负数在前,整数在后,然后模拟过程,半天没搞出来。换了方法,对绝对值排序。搞出来了。#include <iostream>#include <stdio.h>#include <cstring>#include <vector>#include <math.h>#include <...

2014-10-19 22:28:00 125

空空如也

空空如也

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

TA关注的人

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