摘要: 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 名牌果果 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 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 名牌果果 阅读(141) 评论(0) 推荐(0) 编辑
摘要: #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 名牌果果 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 行和列分别考虑,找出右端点中最靠左,左端点最靠右的,必然是最优方案#include#include#include#include#includeusing namespace std;struct Rectangle{ int x1,y1,x2,y2; int x,y; int ... 阅读全文
posted @ 2014-10-30 16:19 名牌果果 阅读(114) 评论(0) 推荐(0) 编辑
摘要: #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 名牌果果 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 晚上做杭电OJ,第二题是一个比较直观的题,我也是太直观了。贴出代码,供自己反省,从7点15分一直做到结束,wa9次。。。。orz。。。。看来自己的算法功底还差的很远很远。 接下的几天,学习大白上的基础算法部分。 #include#include#includeusing namespac... 阅读全文
posted @ 2014-10-25 21:08 名牌果果 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 一、首先最直接的方法求组合数,判断,耗时太大。二、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 名牌果果 阅读(1477) 评论(0) 推荐(0) 编辑
摘要: 很2b的排序负数在前,整数在后,然后模拟过程,半天没搞出来。换了方法,对绝对值排序。搞出来了。#include #include #include #include #include #include using namespace std;int Array[500010];int cmp(int... 阅读全文
posted @ 2014-10-19 22:28 名牌果果 阅读(188) 评论(0) 推荐(0) 编辑