10 2014 档案
摘要:#include #include #include #include #include int Int[10010];int visit[100010];using namespace std;int main(){ int n; while(cin>>n&&n) { ...
阅读全文
摘要:行和列分别考虑,找出右端点中最靠左,左端点最靠右的,必然是最优方案#include#include#include#include#includeusing namespace std;struct Rectangle{ int x1,y1,x2,y2; int x,y; int ...
阅读全文
摘要:#include#include#include#include#includeusing namespace std;struct Line{ int a,b,w;};vector line;vector templine;int n;int workline[20010];bool o...
阅读全文
摘要:晚上做杭电OJ,第二题是一个比较直观的题,我也是太直观了。贴出代码,供自己反省,从7点15分一直做到结束,wa9次。。。。orz。。。。看来自己的算法功底还差的很远很远。 接下的几天,学习大白上的基础算法部分。 #include#include#includeusing namespac...
阅读全文
摘要:一、首先最直接的方法求组合数,判断,耗时太大。二、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,...
阅读全文
摘要:很2b的排序负数在前,整数在后,然后模拟过程,半天没搞出来。换了方法,对绝对值排序。搞出来了。#include #include #include #include #include #include using namespace std;int Array[500010];int cmp(int...
阅读全文

浙公网安备 33010602011771号