<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[就是乐]]></title><description><![CDATA[不喜欢就不要选择，喜欢了就要坚持]]></description><link>https://blog.youkuaiyun.com/stare_at</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; stare_at]]></copyright><item><title><![CDATA[C++ 中sort 函数及 cmp 自定义规则的使用]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/79007258</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/79007258</guid><author>stare_at</author><pubDate>Mon, 08 Jan 2018 21:09:17 +0800</pubDate><description><![CDATA[需要头文件

#include

using namespace std;





这个函数可以传两个参数或三个参数。第一个参数是要排序的区间首地址，第二个参数是区间尾地址的下一地址。也就是说，排序的区间是[a,b)。简单来说，有一个数组int a[100]，要对从a[0]到a[99]的元素进行排序，只要写sort(a,a+100)就行了，默认的排序方式是升序。


需]]></description><category></category></item><item><title><![CDATA[SDUT 2116----数据结构实验之链表一：顺序建立链表]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/51096834</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/51096834</guid><author>stare_at</author><pubDate>Fri, 08 Apr 2016 15:02:38 +0800</pubDate><description><![CDATA[数据结构实验之链表一：顺序建立链表






Time Limit: 1000ms   Memory limit: 65536K  有疑问？点这里^_^


题目描述

输入N个整数，按照输入的顺序建立单链表存储，并遍历所建立的单链表，输出这些数据。

输入

第一行输入整数的个数N；
第二行依次输入每个整数。

输出

输出这组整数。

示例输入]]></description><category></category></item><item><title><![CDATA[SDUT 3329----顺序表应用5：有序顺序表归并(很经典)]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/51083833</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/51083833</guid><author>stare_at</author><pubDate>Thu, 07 Apr 2016 10:49:41 +0800</pubDate><description><![CDATA[顺序表应用5：有序顺序表归并






Time Limit: 100ms   Memory limit: 800K  有疑问？点这里^_^


题目描述

已知顺序表A与B是两个有序的顺序表，其中存放的数据元素皆为普通整型，将A与B表归并为C表，要求C表包含了A、B表里所有元素，并且C表仍然保持有序。

输入

 输入分为三行：
第一行输入m、n（1
第二行]]></description><category></category></item><item><title><![CDATA[考研刷题从现在开始]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/51083488</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/51083488</guid><author>stare_at</author><pubDate>Thu, 07 Apr 2016 10:28:33 +0800</pubDate><description><![CDATA[现在为了考研开始刷题啦
争取一天最少写两篇博客，每天都在山理工上刷简单的题吧
努力吧，赌的就是任性本有的虚荣，以后就没有这种心态了吧，珍惜认真对待每一件事]]></description><category></category></item><item><title><![CDATA[SDUT 3330----顺序表应用6：有序顺序表查询(二分查找)]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/51083414</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/51083414</guid><author>stare_at</author><pubDate>Thu, 07 Apr 2016 10:18:57 +0800</pubDate><description><![CDATA[这个题刚开始是直接遍历的，因为没看见Time Limit是7ms.......


题目描述

顺序表内按照由小到大的次序存放着n个互不相同的整数（1

输入

 第一行输入整数n，表示顺序表的元素个数；
第二行依次输入n个各不相同的有序整数，代表表里的元素；
第三行输入整数t，代表要查询的次数；
第四行依次输入t个整数，代表每次要查询的数值。

输出

 输出t行]]></description><category></category></item><item><title><![CDATA[HDU 1166----敌兵布阵(线段树点更新)]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/50527822</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/50527822</guid><author>stare_at</author><pubDate>Sat, 16 Jan 2016 13:26:57 +0800</pubDate><description><![CDATA[Problem Description
C国的死对头A国这段时间正在进行军事演习，所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段，所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动，可能增加或减少若干人手,但这些都逃不过C国的监视。]]></description><category></category></item><item><title><![CDATA[二叉树建树]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/50442448</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/50442448</guid><author>stare_at</author><pubDate>Thu, 31 Dec 2015 16:29:57 +0800</pubDate><description><![CDATA[利用带空的先序遍历结果建立二叉树：
tree *creat(tree *root)       
{
    char ch;
    scanf("%c",&ch);
    if(ch==',') root=NULL;
    else
    {
        root=new tree;
        root->data=ch;
        root->left=cre]]></description><category></category></item><item><title><![CDATA[HDU 3999----The order of a Tree(二叉树的前序遍历)]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/49253489</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/49253489</guid><author>stare_at</author><pubDate>Mon, 19 Oct 2015 19:06:07 +0800</pubDate><description><![CDATA[二叉树的建立，在主函数里都是返回的是根节点


Problem Description

As we know,the shape of a binary search tree is greatly related to the order of keys we insert. To be precisely:
1.  insert a key k to a empty tree, ]]></description><category></category></item><item><title><![CDATA[POJ 1321----棋盘问题(dfs+回溯)]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/47657629</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/47657629</guid><author>stare_at</author><pubDate>Fri, 14 Aug 2015 10:10:03 +0800</pubDate><description><![CDATA[#include
#include
int n,k,cnt;        
char g[10][10];
int used[10];    //用于放置棋子的列标记
  
void dfs(int row,int num)  
{  
    int i;
    if(num==k)  //当一种方式搜完后，方式加 1；
    {  
        cnt++;  
        re]]></description><category></category></item><item><title><![CDATA[HDU 1010----Tempter of the Bone （dfs+剪枝)]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/47425329</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/47425329</guid><author>stare_at</author><pubDate>Tue, 11 Aug 2015 20:01:30 +0800</pubDate><description><![CDATA[http://acm.hdu.edu.cn/showproblem.php?pid=1010


这个题一开始是用的bfs，可能是我的代码不够优化吧，一直TLE
但是bfs做时应注意一个条件，bfs求得是最短路径等最优化问题，假如找到出口，但是这时需判断当前所用时间和规定时间是否相等，不相等，应剪枝。
用dfs时，应做一下剪枝：
t表示规定时间，mindis表示当前位置到达出口的最短距]]></description><category></category></item><item><title><![CDATA[UVa 10976----Fractions Again?!(枚举)]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/47301923</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/47301923</guid><author>stare_at</author><pubDate>Wed, 05 Aug 2015 19:14:02 +0800</pubDate><description><![CDATA[It is easy to see that for every fraction in the form  (k > 0), we
 can always find two positive integers x and y,x ≥ y, such that: 

.
Now our question is: can you write a program that counts how]]></description><category></category></item><item><title><![CDATA[UVa 11059----Maximum Product(最长上升子序列乘积)]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/47300775</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/47300775</guid><author>stare_at</author><pubDate>Wed, 05 Aug 2015 17:40:49 +0800</pubDate><description><![CDATA[Maximum Product
Time limit: 3.000 seconds

Given a sequence of integers S = {S1, S2, . . . , Sn}, you should determine
 what is the value of themaximum positive product involving consecutive terms]]></description><category></category></item><item><title><![CDATA[UVa 725----Division(枚举)]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/47299613</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/47299613</guid><author>stare_at</author><pubDate>Wed, 05 Aug 2015 16:42:37 +0800</pubDate><description><![CDATA[Description

Write a program that finds and displays all pairs of 5-digit numbers that between them use the digits
0 through 9 once each, such that the first number divided by the second is equal t]]></description><category></category></item><item><title><![CDATA[SDUT 1197----约瑟夫问题]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/46405311</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/46405311</guid><author>stare_at</author><pubDate>Sun, 07 Jun 2015 22:45:45 +0800</pubDate><description><![CDATA[题目描述
n个人想玩残酷的死亡游戏，游戏规则如下： 

n个人进行编号，分别从1到n，排成一个圈，顺时针从1开始数到m，数到m的人被杀，剩下的人继续游戏，活到最后的一个人是胜利者。

请输出最后一个人的编号。
输入
输入n和m值。
输出
输出胜利者的编号。
示例输入

5 3

示例输出

4

#include  
#include  
struct node]]></description><category></category></item><item><title><![CDATA[过桥问题详解]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/46403353</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/46403353</guid><author>stare_at</author><pubDate>Sun, 07 Jun 2015 19:59:45 +0800</pubDate><description><![CDATA[一、问题


　　在漆黑的夜里，四位旅行者来到了一座狭窄而且没有护栏的桥边。如果不借助手电筒的话，大家是无论如何也不敢过桥去的。不幸的是，四个人一共只带了一只手电筒，而桥窄得只够让两个人同时过。如果各自单独过桥的话，四人所需要的时间分别是1、2、5、8分钟；而如果两人同时过桥，所需要的时间就是走得比较慢的那个人单独行动时所需的时间。问题是，如何设计一个方案，让这四人尽快过桥。

　　假设]]></description><category></category></item><item><title><![CDATA[POJ 1700----Crossing River（过桥问题）]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/46403219</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/46403219</guid><author>stare_at</author><pubDate>Sun, 07 Jun 2015 19:45:35 +0800</pubDate><description><![CDATA[Description
A group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement must be arranged in order to row the bo]]></description><category></category></item><item><title><![CDATA[HDU 2669----Romantic（扩展欧几里德求乘法逆元）]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/46403065</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/46403065</guid><author>stare_at</author><pubDate>Sun, 07 Jun 2015 19:20:28 +0800</pubDate><description><![CDATA[我觉得这个算法的难点是对递归调用的理解
具体的参见我上一篇博客



Problem Description
The Sky is Sprite.
The Birds is Fly in the Sky.
The Wind is Wonderful.
Blew Throw the Trees
Trees are Shaking, Leaves are Falling.
Lov]]></description><category></category></item><item><title><![CDATA[递归递归递归递归]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/46402751</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/46402751</guid><author>stare_at</author><pubDate>Sun, 07 Jun 2015 18:35:38 +0800</pubDate><description><![CDATA[上课不好好听的下场就是，自学的时候有的地方理解不到位，做题的时候很痛苦!!!!!
用扩展欧几里德算法求乘法逆元的算法过程，就是对递归调用的深层理解，花了老长时间才搞懂。。
下面是我看的别人博客上的讲解



C通过运行时堆栈支持递归函数的实现。递归函数就是直接或间接调用自身的函数


许多教科书都把计算机阶乘和菲波那契数列用来说明递归，非常不幸我们可爱的著名的老潭老师的《C语言程]]></description><category></category></item><item><title><![CDATA[POJ 3253----Fence Repair 要用到优先队列！！！]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/45920703</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/45920703</guid><author>stare_at</author><pubDate>Fri, 22 May 2015 19:43:28 +0800</pubDate><description><![CDATA[Description


Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs
N (1 ≤ N ≤ 20,000) planks of wood, each having some integer ]]></description><category></category></item><item><title><![CDATA[HDU 2037----今年暑假不AC]]></title><link>https://blog.youkuaiyun.com/stare_at/article/details/45914679</link><guid>https://blog.youkuaiyun.com/stare_at/article/details/45914679</guid><author>stare_at</author><pubDate>Fri, 22 May 2015 11:06:25 +0800</pubDate><description><![CDATA[Description

“今年暑假不AC？” 
“是的。” 
“那你干什么呢？” 
“看世界杯呀，笨蛋！” 
“@#$%^&*%...” 

确实如此，世界杯来了，球迷的节日也来了，估计很多ACMer也会抛开电脑，奔向电视了。 
作为球迷，一定想看尽量多的完整的比赛，当然，作为新时代的好青年，你一定还会看一些其它的节目，比如新闻联播（永远不要忘记关心国家大事）、非常6+7、超级]]></description><category></category></item></channel></rss>