自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

stven_king的专栏

自信人生两百年、会当击水三千尺

  • 博客(240)
  • 资源 (16)
  • 问答 (2)
  • 收藏
  • 关注

原创 HDOJ  1466   计算直线的交点数

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1466我们知道: n条直线互不平行且无三线共点的最多交点数max=1+2+……(n-1)=n(n-1)/2 首先,容易列举出N=1,2,3的情况: 0 0,1 0,2,3   然后,假设   先来看个统计的方法:   假设一共有n=a+b条直线    (即n条直线分成2组,分别

2015-12-18 18:10:19 513

原创 HDOJ  2075   A|B?

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2075#include int main(){    intT,a,b;   scanf("%d",&T);   while(T--)       scanf("%d%d",&a,&b),printf("%s\n",a%b==0?"YES":"NO");    return0;

2015-12-18 18:10:16 639

原创 HDOJ  2055   An easy problem

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2055#include #include #include using namespace std;int main(){    inti,m,n;    chara;   map letter;   for(i=1;i    {       letter.insert(

2015-12-18 18:10:14 520

原创 HDOJ  2054   A == B ?

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2054一道A=B的题,让我提交了四次,很无奈第一次没有考虑长度,第三次没有考虑小数点后面的O,最后一次数组开到10的4次方WA,忍了#include #include void Hou0(char *a, int len){ int flag = 0, sign = 0; for (i

2015-12-18 18:10:11 578

原创 HDOJ  2052  Picture

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2052#include #include using namespace std;int main(){    intn,m;   while(cin>>n>>m)    {       string s(n,'-');       string a(n,' ');     

2015-12-18 18:10:09 472

原创 HDOJ  2015   偶数求和

题目:#include int main(){    intn,m,j,i,sum;   while(scanf("%d%d",&n,&m)!=EOF)    {       sum=0;       for(i=1,j=1;i       {           sum+=i*2;           if(j==m&&i!=n)           {

2015-12-18 18:10:06 363

原创 HDOJ  2029   Palindromes _easy v…

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2029#include#includeusing namespace std;int f(char a[]){ int i=0,n=strlen(a); while(a[i]==a[n-i-1]&&i    i++; return a[i]==a[n-i-1];}int main()

2015-12-18 18:10:03 496

原创 HDOJ   2020   绝对值排序

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2020#include #include int main(){    inta[250],n,i,j,temp;   while(scanf("%d",&n),n)    {       for(i=0;i           scanf("%d",&a[i]);       

2015-12-18 18:10:01 354

原创 HDOJ  2019    数列有序!

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2019#include #include #include using namespace std;int main(){   vector a;    intn,m,i,b;   while(cin>>n>>m,n&&m)    {       for(i=0;i    

2015-12-18 18:09:58 569

原创 HDOJ   2008   数值统计

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2008#include int main(){    intsum1,sum2,sum3,i,a;    doubletemp;   while(scanf("%d",&a),a)    {       sum1=sum2=sum3=0;       for(i=0;i    

2015-12-18 18:09:55 370

原创 HDOJ  2006   求奇数的乘积

i题目:#include int main(){    intsum,i,a,temp;   while(scanf("%d",&a)!=EOF)    {       sum=1;       for(i=0;i       {           scanf("%d",&temp);           if(temp%2)               

2015-12-18 18:09:53 401

原创 HDOJ  2002  计算球体积

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2002#include #define PI 3.1415927int main(){    doubler;   while(scanf("%lf",&r)!=EOF)       printf("%.3lf\n",4/3.0*PI*r*r*r);    return0;}

2015-12-18 18:09:50 528

原创 HDOJ   2001   计算两点间的距离

测试数据很弱,double就可以过了题目:http://acm.hdu.edu.cn/showproblem.php?pid=2001#include #include int main(){    doublex1,x2,y1,y2;   while(scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2)!=EOF)       printf("%.2

2015-12-18 18:09:47 426

原创 HDOJ  2000   ASCII码排序

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2000#include #include #include int cmp( const void *a , const void *b ){   return *(char *)a - *(char*)b;}int main(){    chara[10010];    intle

2015-12-18 18:09:45 612

原创 lower_bound 算法

比如vector _rows中已经有了{0,1,3,5}这是要放入4,则std::lower_bound( _rows.begin(), _rows.end(),4);将会返回5,就是应该插入的那个位置后面的那个值然后_rows.insert( iter, 4);这句将按照从小到大的顺序将4放进去,最后的顺序是{0,1,3,4,5}来一个程序更清楚#include#inclu

2015-12-18 18:09:42 506

原创 C++中的向量学习

自己学习向量感觉这篇的代码挺好用,简单明了.....#include #include //要包含这个头文件using namespace std;int main(void){   vectora(10);//定义了10个整数元素的向量,但没有给出初值,因而,其值是不确定滴。   vectorb(10,1);//定义了10个证书元素的向量,且给出每个元素的初值为1 

2015-12-18 18:09:40 1069

原创 HDOJ  2043   密码

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2043#include #include int main(){    chars[1005];    intn,l,a;   scanf("%d",&n);   while(n--)    {       scanf("%s",s);       l=strlen(s);

2015-12-18 18:09:37 373

原创 HDOJ  2027   统计元音

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2027#include #include int main(){    chars[1005];    intn,a,e,i,o,u,flag=0;   scanf("%d",&n);   getchar();   while(n--)    {       if(flag

2015-12-18 18:09:34 427

原创 HDOJ  2026   首字母变大写

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2026#include #include int main(){    chara[1005];   while(gets(a))    {      if(a[0]>'Z')           printf("%c",a[0]-32);       for(int i=1;

2015-12-18 18:09:32 363

原创 HDOJ   1984    Mispelling4

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1984#include using namespace std;int main(){    intn,a,T=1;    strings;   cin>>n;   while(n--)    {       cin>>a>>s;       cout<<T++<<""

2015-12-18 18:09:29 408

原创 C++中的set

set集合容器——STL Introductionset集合容器使用红黑树(Red-BlackTree)来组织泛化的元素数据。每个节点包含一个取值红色或黑色的颜色域,以便利于进行树的平衡处理。作为节点键值元素的插入,必须确保每个子树根节点的键值大于左子树所有节点的键值,而小于右子树所有节点的键值。重复的键值不能插入容器,键值插入也无需指定具体的插入位置,而是按照元素在树中的关联关系,进行位置

2015-12-18 18:09:27 861

转载 [转]C++map的基本操作和使用

2012年的夏天原文地址:[转]C++map的基本操作和使用作者:蓠閞姒后来源:http://blog.csdn.net/mjshldcsd/article/details/72069011、map简介map是一类关联式容器。它的特点是增加和删除节点对迭代器的影响很小,除了那个操作节点,对其他的节点都没有什么影响。对于迭代器来说,可以修改实值,而不能修改key。2、map的功能

2015-12-18 18:09:25 625

原创 HDOJ&nbsp;&nbsp;4300&nbsp;&nbsp;&nbsp;Clairewd’s&nbsp;message

题目:http://acm.hdu.edu.cn/showproblem.php?pid=4300#include#include#includeusing namespace std;const int L=100010;char a[100],b[100];char str[L],pat[L];int fail[L];int kmp(int n){    inti,j,

2015-12-18 18:09:22 581

原创 HDOJ&nbsp;&nbsp;&nbsp;1321&nbsp;&nbsp;Reverse&nbsp;Text

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1321#include #include #include using namespace std;int main(){    strings;    int n;   cin>>n;   getchar();  //去掉回车*******   while(n--)   

2015-12-18 18:09:19 474

原创 HDOJ&nbsp;&nbsp;1251&nbsp;&nbsp;统计难题

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1251作者一道题时我开始向怎么去读取那连续的两个回车,让读入断开,最后在网上找了代码看了原来如此简单#include#include#include #includeusing namespace std;mapf;int main(){ int i; char a[11]; wh

2015-12-18 18:09:17 382

原创 HDOJ&nbsp;&nbsp;1161&nbsp;&nbsp;&nbsp;Eddy&#039;s&nbsp;mistakes

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1161#include #include #include using namespace std;int main(){    stringa;   while(getline(cin,a))    {       for(int i=0;i       {        

2015-12-18 18:09:14 634

原创 HDOJ&nbsp;&nbsp;1062&nbsp;&nbsp;&nbsp;Text&nbsp;Reverse

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1062这一道题自己提交了很多遍,开始是超时,然后还用strtok函数与strrev函数进行输出但是编译通不过,只好又用一个字符,一个字符的输入和输出,结果AC了,最后自己还是不甘心,又用了strrev函数和strtok函数把编译器换为C++通过了,蛋疼啊,浪费了我半个小时时间啊,让我白白提交了5次啊

2015-12-18 18:09:12 634

原创 HDOJ&nbsp;&nbsp;4256&nbsp;&nbsp;&nbsp;The&nbsp;Famous&nbsp;Clock

题目:http://acm.hdu.edu.cn/showproblem.php?pid=4256#include using namespace std;int main(){    strings;    intn,T=1;   while(cin>>s)    {       if(s=="I")  n=1;       if(s=="II")  n=2;  

2015-12-18 18:09:09 794

原创 HDOJ&nbsp;&nbsp;&nbsp;4252&nbsp;&nbsp;&nbsp;A&nbsp;Famous&nbsp;City

题目:http://acm.hdu.edu.cn/showproblem.php?pid=4252题目有几个重要的地方每一个“0”,都会将建筑物分割开,高的建筑物可以挡住低的,低的挡不住高的eg:212        =3  121        =2用scanf比较好些,cin会超时#include #include #include #include using n

2015-12-18 18:09:07 495

原创 HDOJ&nbsp;&nbsp;4247&nbsp;&nbsp;A&nbsp;Famous&nbsp;ICPC&nbsp;Team

题目:http://acm.hdu.edu.cn/showproblem.php?pid=4247#include #include #include using namespace std;int main(){    inta[4],T=1;   while(scanf("%d%d%d%d",&a[0],&a[1],&a[2],&a[3])!=EOF)    {   

2015-12-18 18:09:04 625

原创 HDOJ&nbsp;&nbsp;4245&nbsp;&nbsp;&nbsp;A&nbsp;Famous&nbsp;Music&nbsp;Comp…

题目:http://acm.hdu.edu.cn/showproblem.php?pid=4245这是2012年暑假的热身赛第一道题,很悲剧WA了很多遍题目没有读清楚,下面给的信息都是无用的(很坑....但是到底还是自己不细心,#include using namespace std;int main(){    strings1,s2,temp;    intn,T=1;

2015-12-18 18:09:01 629

原创 HDOJ&nbsp;&nbsp;&nbsp;2544&nbsp;&nbsp;&nbsp;最短路

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2544#include #define INF 10000000#define MAXN200   //数组一定要开大........int n,m;int Edge[MAXN][MAXN];int s[MAXN],dist[MAXN];void Dijkstra(int v0){  

2015-12-18 18:08:59 425

原创 HDOJ&nbsp;&nbsp;2537&nbsp;&nbsp;&nbsp;8球胜负

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2537#include using namespace std;int main(){    chara;    strings;    intn,red,yellow,c,d;   while(cin>>n,n)    {       yellow=red=0;      

2015-12-18 18:08:56 364

原创 HDOJ&nbsp;&nbsp;2203&nbsp;&nbsp;&nbsp;亲和串

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2203这道题基本来说很简单,只要会用find这个函数,eg: 查看: 字符串是否包含子串  如果包含则返回子串在目标串中第一次出现的位置    stringstr12= "I am a student", str13= "student", str14="aaaaaaa";    if(st

2015-12-18 18:08:54 542

原创 HDOJ&nbsp;&nbsp;2201&nbsp;&nbsp;&nbsp;熊猫阿波的故事

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2201题读懂就可以,每个人做在每一个位置上的概率是相同的,所以我们可以看做他是第一个上去的乘客#include int main(){    intn,m;   while(scanf("%d%d",&n,&m)!=EOF)   {  printf("%0.2lf\n",1.0/n

2015-12-18 18:08:51 465

原创 HDOJ&nbsp;&nbsp;1875&nbsp;&nbsp;&nbsp;畅通工程再续

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1875找最小生成树,Prim算法搞定....#include #include #include #define INF 100000000#define MAXN 250int n;int Edge[MAXN][2];double edges[MAXN][MAXN];double lo

2015-12-18 18:08:49 418

原创 HDOJ&nbsp;&nbsp;1874&nbsp;&nbsp;&nbsp;畅通工程续

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1874开始学习最短路,感觉Dijkstra算法还挺好用的......#include #define INF 10000000#define MAXN 250int n,m,beg,end;int Edge[MAXN][MAXN];int s[MAXN],dist[MAXN];void Di

2015-12-18 18:08:46 437

原创 HDOJ&nbsp;&nbsp;1862&nbsp;&nbsp;&nbsp;EXCEL排序

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1862这道题容易TLE,我提交了好多次,最后发现原来是选择判断是用了if而没有用switch,最后上网找了一下,发现在多次需要判断的情况下,if所用时间要大于switch,#include #include #include typedef struct{    intnumber;  

2015-12-18 18:08:44 489

原创 HDOJ&nbsp;&nbsp;1859&nbsp;&nbsp;&nbsp;最小长方形

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1859求出最大的和最小的即可,,,,,,,#include #include using namespace std;typedef struct{    inta,b;}KG;KG zu[10010];int main(){    inti=0,j=0;   while(c

2015-12-18 18:08:41 438

原创 HDOJ&nbsp;&nbsp;1233&nbsp;&nbsp;&nbsp;还是畅通工程

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1233开始做图论的题这些还是比较好的,简单容易#include #define INF 1000000#define MAXN 205int Edge[MAXN][MAXN];int lowcost[MAXN];int min_tree(int n){    inti,j,k;   

2015-12-18 18:08:39 405

tonic-refs_heads_master.tar.gz

Google开发的新的操作系统Fuchsia其中的tonic相关的代码,在学习flutter和dart源码的时候里面会用到部分代码。

2019-08-09

微信webview唤起外部客户端接入说明2018版

微信webview唤起外部客户端接入说明2018版。 为提升微信 webivew 中网页打开其他应用的体验,防止诱导点击、强制跳出等不合理行为, 我们的“唤起外部客户端”的能力统一调整为: 1、 在 6.5.16 及以上版本的微信客户端中,贵方网页将只能使用 launchApplication 接口,打 开其他应用。该接口会在唤起前要求用户接受弹窗确认。 2、 在 6.5.16 以下版本的微信客户端中,贵方网页可以继续使用现有方式,打开其他应用。

2019-02-21

gradle_2.0.0-instant-run源码

gradle_2.0.0-instant-run源码,可查看BootstrapApplication,IncrementalClassLoader等类。

2018-05-10

红黑树相关代码以及解析

红黑树的添加、删除、遍历等代码&以及注释,提供测试样例~!

2018-03-12

深入探索Android热修复技术原理

阿里巴巴开源的《深入探索Android热修复技术原理》,其中讲述了热修复技术以及原理。

2017-11-09

BinaryTree二叉树操作相关代码

二叉树相关操作:判断是否为二叉排序树、完全二叉树、二叉平衡树;翻转二叉树,求树的深度、叶子节点个数,某节点到根节点的路径,两个节点的最近公共节点等等。

2017-10-19

IntelliJ IDEA入门图文教程整理(全部)

史上最全的的Intellij IDEA使用文档,图文结合正确的描述个性化的设置。适用于Intellij IDEA,Android Studio,Web Storm等等。

2016-10-17

org.apache压缩工具包

由apache提供的压缩解压工具类,比JDK原生类库中的方法更好使用。

2015-04-02

Java中的pingying工具包pinyin4j-2.5.0.jar

汉子转化拼音的工具包,可以把汉子的字母提取出来,这样方便与做类似于通讯录的Demo。

2014-08-08

Eclipse智能提示删除空格,等于,分号键,点上屏

Eclipse其Version: 4.2.2的去掉不需要的(eg:空格或等号或其他)按键上屏提示,增加自己需要的按键提示。

2014-08-07

动态绘制图片

BitMap代表一张位图,BitmapDrawable里封装的图片就是一个Bitmap对象,开发者被一个Bitmap对象包装成BitmapDrawable对象,可以调用BitmapDrawable的构造器。再者对它进行平移,缩放,旋转等。

2014-07-23

NotificationDemo

调用getSystemService(NOTIFICATION_SERVICE)方法获取系统的NotifacationManager服务 通过构造器创建一个Notification对象 为Notification设置各种属性 通过NotificationManager发送Notification。

2014-07-16

FTP套接字编程

在前三个实验的基础上,将其改造为一个能传输指定文件名称的点对点文件传输软件 设计并实现一个支持多个客户端的文件传输服务器 客户端等待键盘输入文件名称,然后将文件名称传输给服务器,服务器在预先设置好的文件夹下查找该文件,如果发现同名文件,开始传输回客户端,客户端接收完文件后将文件以输入的文件名称保存在本地某个目录即可,否则告诉客户端文件不存在。

2014-04-23

Windows下多线程套接字编程

windows下的多线程的并发的套接字编程

2014-04-09

Windows平台简单socket编程

(1)在Windows上,编写、编译1个客户机端程序和1个服务器端程序。要求客户机端程序能发送请求给服务器端程序,服务器端程序收到后能发送本机时间给客户机端程序。 (2)在相同或不同机子上,先运行服务器端程序可执行文件,后运行客户机端程序可执行文件。

2014-03-27

内排序算法比较

1) 对以下 6 种常用的内部排序算法进行比较:起泡排序,直接插入排序,简单选择排 序,快速排序,希尔排序,堆排序。 2) 待排序记录的文件个数不小于 1000( 其数据用伪随机数产生 ),至少用5 组不同的 输入数据作比较;比较的指标为关键字的比较次数和关键字的移动次数(一次关键 字交换计为3 次移动)。 3) 统计在完全正序、完全逆序及无序情况下的关键字比较次数和移动次数。 4) 对结果作简单分析,包括对各组数据得出结果波动大小的解释。

2013-03-14

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

TA关注的人

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