会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
名牌果果
博客园
首页
新随笔
联系
管理
订阅
2015年4月3日
归并排序求逆序数对。
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int high[100010]; 7 int temp[100010]; 8 int angry[100010]; 9 int num;10 void...
阅读全文
posted @ 2015-04-03 23:11 名牌果果
阅读(104)
评论(0)
推荐(0)
2014年11月7日
Two Sum
摘要: struct node{ int n; int value;};bool cmp(node a,node b){ return a.value twoSum(vector &numbers, int target) { vector a; vect...
阅读全文
posted @ 2014-11-07 23:20 名牌果果
阅读(151)
评论(0)
推荐(0)
2014年10月31日
uva11100 贪心
摘要: #include #include #include #include #include int Int[10010];int visit[100010];using namespace std;int main(){ int n; while(cin>>n&&n) { ...
阅读全文
posted @ 2014-10-31 13:32 名牌果果
阅读(224)
评论(0)
推荐(0)
2014年10月30日
uva11134 贪心 回溯必tle 规模5000
摘要: 行和列分别考虑,找出右端点中最靠左,左端点最靠右的,必然是最优方案#include#include#include#include#includeusing namespace std;struct Rectangle{ int x1,y1,x2,y2; int x,y; int ...
阅读全文
posted @ 2014-10-30 16:19 名牌果果
阅读(124)
评论(0)
推荐(0)
2014年10月26日
LA 4254 这个为什么会超时?
摘要: #include#include#include#include#includeusing namespace std;struct Line{ int a,b,w;};vector line;vector templine;int n;int workline[20010];bool o...
阅读全文
posted @ 2014-10-26 21:05 名牌果果
阅读(198)
评论(0)
推荐(0)
2014年10月25日
复习基础算法的感想
摘要: 晚上做杭电OJ,第二题是一个比较直观的题,我也是太直观了。贴出代码,供自己反省,从7点15分一直做到结束,wa9次。。。。orz。。。。看来自己的算法功底还差的很远很远。 接下的几天,学习大白上的基础算法部分。 #include#include#includeusing namespac...
阅读全文
posted @ 2014-10-25 21:08 名牌果果
阅读(171)
评论(0)
推荐(0)
2014年10月24日
判断组合数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);接下来若a>b+c,...
阅读全文
posted @ 2014-10-24 23:51 名牌果果
阅读(1606)
评论(0)
推荐(0)
2014年10月19日
uva11039
摘要: 很2b的排序负数在前,整数在后,然后模拟过程,半天没搞出来。换了方法,对绝对值排序。搞出来了。#include #include #include #include #include #include using namespace std;int Array[500010];int cmp(int...
阅读全文
posted @ 2014-10-19 22:28 名牌果果
阅读(195)
评论(0)
推荐(0)
公告