自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

逆风的方向 更适合飞翔

邮箱:sr19930829@163.com

  • 博客(527)
  • 资源 (10)
  • 收藏
  • 关注

原创 [BestCoder] Round #8

1001http://acm.hdu.edu.cn/showproblem.php?pid=4989#include #include #include #include #include #include #include #include #include #include #include #include #include #define rd(x)

2015-02-01 15:47:37 1004

原创 [BestCoder] Round #7

1001http://acm.hdu.edu.cn/showproblem.php?pid=4985输出循环节#include #include #include #include #include #include #include #include #include #include #include #include #include #define

2015-02-01 15:43:05 889

原创 [BestCoder] Round #6

1001http://acm.hdu.edu.cn/showproblem.php?pid=4981#include #include #include #include #include #include #include #include #include #include #include #include #include #define rd(x)

2015-02-01 15:28:15 981

原创 [BestCoder] Round #5

1001http://acm.hdu.edu.cn/showproblem.php?pid=4956#include #include #include #include #include #include #include #include #include #include #include #include #include using namespac

2015-02-01 15:24:00 779

原创 [BestCoder] Round #4

1001http://acm.hdu.edu.cn/showproblem.php?pid=4931#include #include #include #include #include #include #include #include #include #include #include #include #include using namespac

2015-02-01 15:22:09 806

原创 [BestCoder] Round #3

1001http://acm.hdu.edu.cn/showproblem.php?pid=4907#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace

2015-02-01 15:16:58 1148

原创 [BestCoder] Round #2

1001题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4883题意为:有n组客人来吃饭,给出每组客人的人数及用餐开始时间,结束时间,格式为hh:mm;要求一组客人来的时候就必须给其安排位子,问最少需要多少把椅子才能做到(一位客人需要一把椅子).方法:time[i],表示第i分钟有多少用餐的人,也就是需要多少把椅子,将开始时间,结束

2015-02-01 15:08:21 1114

原创 [ACM] HDU 1242 Rescue (优先队列)

RescueProblem Description Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M Angel's friends want to save Angel. Their task is:

2015-01-14 10:37:33 1822 2

原创 [ACM] POJ 3740 Easy Finding (DFS)

Easy FindingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 16482 Accepted: 4476DescriptionGiven a M×N matrix A. Aij ∈ {0, 1} (0 ≤ i < M, 0 ≤ j < N), co

2015-01-14 10:30:13 1249

原创 [ACM] HDU 4885 TIANKENG’s travel (特殊建图,最短路)

TIANKENG’s travel   Problem Description TIANKENG has get a driving license and one day he is so lucky to find a car. Every day he drives the car around the city. After a month TIANKE

2015-01-13 17:51:01 1565

原创 [ACM] HDU 4884 TIANKENG’s rice shop (模拟)

TIANKENG’s rice shopProblem Description TIANKENG managers a pan fried rice shop. There are n kinds of fried rice numbered 1-n. TIANKENG will spend t time for once frying. Because the pan i

2015-01-13 17:29:28 1865

原创 [ACM] HDU 4883 TIANKENG’s restaurant

TIANKENG’s restaurantTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 931    Accepted Submission(s): 412Problem Description TIAN

2015-01-13 17:13:59 992

原创 [ACM] ZOJ 3844 Easy Task (模拟+哈希)

Easy TaskTime Limit: 2 Seconds      Memory Limit: 65536 KBYou are given n integers. Your task is very easy. You should find the maximum integer a and the minimum integer b among these n inte

2015-01-11 19:21:58 1972

原创 [动态规划] 最长递增子序列 (Longest Increasing Subsequence)

1.复杂度为O(n^2)const int maxn=100020;const int inf=0x3f3f3f3f;int dp[maxn];//以a[i]为结尾的最长自增子序列长度int a[maxn];int n;int LIS(int a[],int n)//最长上升子序列{ int m; dp[0]=1; for(int i=1;i<n;i++)

2014-12-23 11:56:22 2154

原创 [数论] Miller_Rabbin算法判断大素数,Pollard_rho算法进行质因素分解

讲解转载于:http://www.cnblogs.com/rainydays/archive/2011/09/01/2162049.html   http://blog.sina.com.cn/s/blog_86a9d97201015cj7.htmlMiller-rabinMiller-rabin算法是一个用来快速判断一个正整数是否为素数的算法。它利用了费马小定理,即:如果p是质数,且

2014-12-23 10:43:37 3680

原创 [ACM] HDU 5135 Little Zu Chongzhi's Triangles (一堆木棍组成三角形最大面积)

Little Zu Chongzhi's TrianglesProblem DescriptionZu Chongzhi (429–500) was a prominent Chinese mathematician and astronomer during the Liu Song and Southern Qi Dynasties. Zu calculated the

2014-12-22 10:55:05 2744

原创 [ACM] HDU 5137 How Many Maos Does the Guanxi Worth(去掉一个点使得最短路最大化)

How Many Maos Does the Guanxi WorthProblem Description"Guanxi" is a very important word in Chinese. It kind of means "relationship" or "contact". Guanxi can be based on friendship, but als

2014-12-22 10:05:30 1341

原创 [ACM] hdu 5147 Sequence II (树状数组,前缀和,后缀和)

Sequence IIProblem DescriptionLong long ago, there is a sequence A with length n. All numbers in this sequence is no smaller than 1 and no bigger than n, and all numbers are different in

2014-12-21 14:59:16 2414

原创 Computer English : Material Design ( 专业英语考核大作业)

看了一些资料,然后花一个多小时写的,有些句子可能不太对...Material DesignNowadays, softwares are everywhere we can see and the user interface of every single one of them is quite different. In some aspects, it’

2014-12-13 21:39:54 2064

原创 [图论] 二分图匹配(匈牙利算法)

介绍部分转载于维基百科:匈牙利算法是众多用于解决线性任务分配问题的算法之一,是用来解决二分图最大匹配问题的经典算法,可以在多项式时间内解决问题,由美国数学家Harold Kuhn 于1955年提出。此算法之所以被称作匈牙利算法是因为算法很大一部分是基于以前匈牙利数学家Dénes Kőnig和Jenő Egerváry的工作之上创建起来的.问题简介:设G=(V,E)是一个无向图。如顶

2014-12-10 11:13:44 2887

原创 [图论] LCA(最近公共祖先)Tarjan 离线算法

很好的参考资料:http://taop.marchtea.com/04.04.html    下面的配图和部分文字转载于此文章离线算法就是指统一输入后再统一输出,而不是边输入边实时输出。Tarjan算法的复杂度为O(N+Q),Q为询问的次数.由于是离线算法,所以要保存输入的信息,次序问题。 若两个结点u、v分别分布于某节点t 的左右子树,那么此节点 t即为u和v的最近公共祖先。更进

2014-12-09 21:19:27 4051 1

原创 [图论] 有向图强连通分量 (kosaraju算法,Tarjan算法)

记录自己的想法:在有向图中,如果一些顶点中任意两个顶点都能互相到达(间接或直接),那么这些顶点就构成了一个强连通分量,如果一个顶点没有出度,即它不能到达其他任何顶点,那么该顶点自己就是一个强连通分量。在用kosaraju算法和Tarjan算法求强连通分量的时候,就是给所有的顶点分组染色,同一种颜色的顶点在同一个强连通分量中,记录有多少种颜色(有多少个强联通分量),每个顶点属于哪种颜色(每个顶点在哪

2014-12-09 09:46:02 5014

原创 [ACM] HDU 5139 Formula (离线处理)

FormulaProblem Descriptionf(n)=(∏i=1nin−i+1)%1000000007You are expected to write a program to calculate f(n) when a certain n is given. InputMulti test cases (about 10000

2014-12-07 09:49:23 2270

原创 Codeforces Round #281 (Div. 2)

A.模拟题题目链接:http://codeforces.com/contest/493/problem/A题意为:给出两个队伍名home队和away队,然后给出n条信息,每条信息包括四个值,在什么时间,哪个队,该队的几号,得到了黄牌或者红牌,如果得到了两个黄牌,那么自动得到一张红牌,我们关心的是两个队的球员第一次得到红牌的情况,如果在输入的时候发现有球员第一次得到了红牌,那么就输出该球员的

2014-12-05 21:13:23 1729

原创 数据库上机脚本

论U盘备份的重要性。。。U盘突然间坏了,而且是硬件问题。。。软件工程文档,并行计算大作业,所有数据库上机脚本都没有了。。哭死。。。CREATE table Student(sno char(10) not null, sname varchar(10) null, sage tinyint,

2014-12-04 17:13:45 1606

原创 [ACM] HDU 1269 迷宫城堡(Tarjan算法求强联通分量)

迷宫城堡Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8099    Accepted Submission(s): 3623Problem Description 为了训练小希的方向感,Gardon建立了

2014-12-04 01:37:31 2421

原创 [ACM] HDU 5131 Song Jiang's rank list (模拟)

Song Jiang's rank listTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 36    Accepted Submission(s): 18Problem Description《Shui H

2014-12-03 20:32:03 1967

原创 [ACM] hihocoder 1062 最近公共祖先·一 (一般做法)

描述小Ho最近发现了一个神奇的网站!虽然还不够像58同城那样神奇,但这个网站仍然让小Ho乐在其中,但这是为什么呢?“为什么呢?”小Hi如是问道,在他的观察中小Ho已经沉迷这个网站一周之久了,甚至连他心爱的树玩具都弃置一边。“嘿嘿,小Hi,你快过来看!”小Ho招呼道。“你看,在这个对话框里输入我的名字,在另一个对话框里,输入你的名字,再点这个查询按钮,就可以查出来……什么!我们居然有

2014-11-29 20:31:55 2360

原创 [ACM] sdut 2877 angry_birds_again_and_again (简单数学积分)

angry_birds_again_and_againTime Limit: 2000ms   Memory limit: 65536K  有疑问?点这里^_^题目描述The problems called "Angry Birds" and "Angry Birds Again and Again" has been solved by many

2014-11-27 20:48:28 1918

原创 [数论] 高斯消元(整型和浮点型)

高斯消元法:数学上,高斯消元法(或译:高斯消去法)(英语:Gaussian Elimination),是线性代数中的一个算法,可用来为线性方程组求解,求出矩阵的秩,以及求出可逆方阵的逆矩阵。当用于一个矩阵时,高斯消元法会产生出一个“行梯阵式”。(来自维基百科)构造如下方程:a[0][0]*X0 + a[0][1] *X1 + a[0][2]*X2+...........a[0][n

2014-11-27 19:42:27 3461

原创 [ACM] sdut 2882 Full Binary Tree (满二叉树的公共祖先)

Full Binary TreeTime Limit: 2000ms   Memory limit: 65536K  有疑问?点这里^_^题目描述In computer science, a binary tree is a tree data structure in which each node has at most two children

2014-11-27 19:23:17 2120

原创 [ACM] sdut 2878 Circle (高斯消元)

CircleTime Limit: 2000ms   Memory limit: 65536K  有疑问?点这里^_^题目描述You have been given a circle from 0 to n - 1. If you are currently at x, you will move to (x - 1) mod n or (x + 1

2014-11-27 19:09:58 2459

原创 [ACM] hihocoder 1066 无间道之并查集

描述这天天气晴朗、阳光明媚、鸟语花香,空气中弥漫着春天的气息……额,说远了,总之,小Hi和小Ho决定趁着这朗朗春光出去玩。但是刚刚离开居住的宾馆不久,抄近道不小心走入了一条偏僻小道的小Hi和小Ho就发现自己的前方走来了几个彪形大汉,定睛一看还都是地地道道的黑人兄弟!小Hi和小Ho这下就慌了神,捡肥皂事小,这一身百把来斤别一不小心葬身他乡可就没处说去了。就在两人正举足无措之时,为首的黑叔

2014-11-25 20:57:43 1762

原创 [ACM]codeorces 488A Giga Tower (暴力枚举)

A. Giga Towertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputGiga Tower is the tallest and deepest building

2014-11-25 19:56:23 1743

原创 [数据结构] 字典树

字典树百度百科:又称单词查找树,Trie树,是一种树形结构,是一种哈希树的变种。典型应用是用于统计,排序和保存大量的字符串(但不仅限于字符串),所以经常被搜索引擎系统用于文本词频统计。它的优点是:利用字符串的公共前缀来减少查询时间,最大限度地减少无谓的字符串比较,查询效率比哈希表高。学习了字典树之后,觉得它很明显的就是用空间来换时间,空间复杂度特别大,比如字典数单单存26个小写字母,那么每个节

2014-11-21 11:52:23 2711

原创 [ACM] ZOJ Martian Addition (20进制的两个大数相加)

Martian AdditionTime Limit: 2 Seconds      Memory Limit: 65536 KB  In the 22nd Century, scientists have discovered intelligent residents live on the Mars. Martians are very fond of mathematics

2014-11-19 19:06:32 1957

原创 [数据结构]线段树

hihocoder上的这一篇文章写得特别赞!很好理解。“在我介绍别的算法之前,你先来讲一讲你是准备如何使用线段树来解决这个问题的吧?”小Hi虽然做好了讲解的准备,但是还是希望能够一步步引导小Ho进行思考,于是这般说道。“唔……那我先从线段树的定义说起吧:线段树其实本质就是用一棵树来维护一段区间上和某个子区间相关的值——例如区间和、区间最大最小值一类的。”小Ho说道:“它的具体做

2014-11-18 20:57:42 1933

原创 [ACM] hihoCoder 1075 开锁魔法III (动态规划,组合数学)

描述一日,崔克茜来到小马镇表演魔法。其中有一个节目是开锁咒:舞台上有 n 个盒子,每个盒子中有一把钥匙,对于每个盒子而言有且仅有一把钥匙能打开它。初始时,崔克茜将会随机地选择 k 个盒子用魔法将它们打开。崔克茜想知道最后所有盒子都被打开的概率,你能帮助她回答这个问题吗?输入第一行一个整数 T (T ≤ 100)表示数据组数。 对于每组数据,第一行有两个整数 n 和 k (1 ≤

2014-11-13 20:50:04 2548

原创 [ACM] POJ 2689 Prime Distance (大区间素数筛选)

Prime DistanceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12811 Accepted: 3420DescriptionThe branch of mathematics called number theory is about p

2014-11-12 12:11:33 3007

原创 [数论]素数相关整理

1.单独判断一个数是否为素数bool prime(int n){ if(n==0||n==1) return false; if(n==2) return true; for(int i=2;i<=sqrt(n);i++) if(n%i==0) return false; return true;}

2014-11-12 10:00:43 3036

ListView异步显示,优化最终版本

实现了ListView的异步加载,涉及到Json数据解析,多线程和AsyncTask的使用,缓存机制以及滑动优化。

2016-04-13

最终实现ListView的异步加载

最终实现ListView的异步加载

2016-04-13

listView异步加载(多线程和AsyncTask)以及缓存的使用

用多线程和AsyncTask两种方式去实现ListView上的网络图片异步加载,其中涉及到到Json的数据解析,根据网络连接获取图片等知识。并添加了缓存机制。

2016-04-13

ListView异步加载(暂时未实现图片异步加载)

listView利用BaseAdapter, item为图片和两个字符串,暂时没实现图片的异步加载。

2016-04-13

AsyncTask加载网络图片并模拟进度条更新

该例子很好的展示了AsyncTask类的几个方法 doInBackground 必须重写,异步执行后台线程将要完成的任务 onPreExecute 执行后台耗时操作前被调用,通常用户完成一些初始化操作 onPostExecute 当doInBackground()完成后,系统会自动调用,并将doInBackground方法返回的值传给该方法。 onProgressUpdate 在doInBackground()方法中调用publishProgress()方法是怎么工作的,AsyncTask加载网络图片展示了doInBackground onPreExecute onPostExecute的工作顺序,模拟进度条更新展示了onProgressUpdate怎么工作的

2016-04-13

AsyncTask加载网络图片

demo详细的展示了怎样用异步处理加载网络上的一个图片,并在页面上显示

2016-04-13

BaseAdapter的使用Demo

怎样使用BaseAdapter

2016-04-13

上海交大ACM模板

上海交大ACM模版,里面内容挺详细的,代码很全。

2013-12-08

GPU-Z.0.6.2H

GPU_Z小工具 检测电脑的小工具 很方便使用

2013-05-31

空空如也

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

TA关注的人

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