自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 ViewPager中嵌套Fragment,切换之后出现空白页没有加载数据的解决方法

问题描述: ViewPager中嵌套ViewPager并用Fragment填充数据,但是在切换外部ViewPager之后,却没办法加载内部ViewPager中的数据。例如:当切换我界面之后再返回星座界面,就加载不了其中的数据。解决方案: adapter = new TabAdapter(getFragmentManager(), consName, mConsFragments); adap

2016-12-27 11:30:31 3025 4

原创 无法访问HttpRequestBase 找不到org.apache.http.client.methods.HttpRequestBase的类文件

Error:(53, 35) 错误: 无法访问HttpRequestBase 找不到org.apache.http.client.methods.HttpRequestBase的类文件在build.gradle中添加android {    useLibrary'org.apache.http.legacy'}

2016-03-08 10:32:43 1955

原创 用邻接矩阵存储有向图 输出各点的出度和入度

代码:#include #include#include#includeusing namespace std;const int maxn= 110;int edge[100][100],n,m;//顶点数,有向边数,邻接矩阵;int mc,md,u,v;//入度,出度,边的起点,终点;void f(){    for(int i=1;i    {

2014-08-06 16:57:37 3342

原创 最小生成树 prime算法 求权值最大的边

Out of HayDescriptionThe cows have run out of hay, a horrible event that must be remedied immediately. Bessie intends to visit the other farms to survey their hay situation. There are N (2 <= N

2014-08-06 16:48:23 1219

原创 最小生成树 prime算法

Agri-NetDescriptionFarmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course. Farm

2014-08-06 16:40:19 417

转载 多柱汉诺塔最优算法设计探究

引言汉诺塔算法一直是算法设计科目的最具代表性的研究问题,本文关注于如何设计多柱汉诺塔最优算法的探究。最简单的汉诺塔是三个柱子(A、B、C),因此多柱汉诺塔的柱子个数M≥3。下面从三柱汉诺塔说起,慢慢深入我们要关心的问题。1. 三柱汉诺塔三柱汉诺塔是经典的汉诺塔问题,在算法设计中是递归算法的典型问题。其算法是这样的: 首先把A 柱上面的n- 1 个碟子通过C 柱移到B 柱上【T(n-1)

2014-07-31 10:39:11 981

原创 穿越沙漠问题

用一辆吉普车穿越1000公里的沙漠。吉普车的总装油量为500加仑,耗油率为1加仑/公里。由于沙漠中没有油库,必须先用这辆车在沙漠中建立临时油库。该吉普车以最少的耗油量穿越沙漠,应在什么地方建油库,以及各处的贮油量。

2014-07-30 15:24:32 9354

原创 3982 序列

序列Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6949 Accepted: 3127Description数列A满足An = An-1 + An-2 + An-3, n >= 3 编写程序,给定A0, A1 和 A2, 计算A99In

2014-07-28 10:15:00 335

原创 士兵杀敌(一)

士兵杀敌(一)时间限制:1000 ms  |  内存限制:65535 KB难度:3描述 南将军手下有N个士兵,分别编号1到N,这些士兵的杀敌数都是已知的。小工是南将军手下的军师,南将军现在想知道第m号到第n号士兵的总杀敌数,请你帮助小工来回答南将军吧。注意,南将军可能会问很多次问题。输入只有一组测试数据第一行是两个整数N,M,其中N表示士兵的个数(1

2014-07-10 16:46:15 334

转载 购票 组合数学

#include #include#includeusing namespace std;const int N=400;char store[203][N];//将整数n转化为字符串s;void itos(int n,char *s){    int i,j,t[5];    if(n==0)    {        s[0]='0';s[1]='

2014-05-18 18:56:23 444

原创 取(m堆)石子游戏 杭电2176

#include #include#include#includeusing namespace std;int NStone[200001];int main(){    int n,sum,sum1;    while(cin>>n&&n!=0)    {        sum=0;        for(int i=0;i        {

2014-05-12 16:20:00 456

原创 348 南阳理工 暴力算法

#include #includeusing namespace std;int main(){    int k,n;    cin>>k;    while(k--)    {        cin>>n;        if(n==1)  cout        if(n==2)  cout        if(n==3)  cout

2014-05-09 15:37:46 572 1

原创 strcmp()函数

stu[i].name 和 str是两个字符串strcmp是一个判断两个字符串是否相等的函数,如果相等,函数结果为0,否知为负数或正数如果两个字符串相等,就!0就执行if语句里面的内容

2014-05-08 09:33:54 618

原创 按灯泡

#include using namespace std;int prime[1000030],isprime[100020],num[1000004];int main(){    int temp=0,t,n,num1,num2,max,min,index,sum;    for(int i=1;i        prime[i]=1;    for(i

2014-05-06 20:25:56 477

原创 487-3279

#include #include#includeusing namespace std;typedef struct trietree* Ptree;struct trietree{    bool arrive;    int treenum;    Ptree next[10];}node[1000000];int size;bool find

2014-05-05 18:39:03 480

原创 max num

#include using namespace std;int main(){ int t,n,i,j,a[100000]; int sum,s1,s2,e,max,k=0; cin>>t; while(t--) { cin>>n; //memset(a,a+n;sizeof(a)); for(

2014-05-03 17:43:15 795

原创 会场安排

#include 02.#include03.const int maxn = 10000+100;04.using namespace std;05.typedef struct06.{07.int s;08.int e;09.}Node;10.bool cmp(Node x, Node y)11.{

2014-05-03 17:41:12 460

空空如也

空空如也

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

TA关注的人

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