云胡同学
云胡同学
全部文章
算法
C++(8)
java(2)
leetcode(34)
python(11)
Web前端(11)
剑指offer(1)
基础小项目(1)
小程序(1)
我的安卓之路(11)
数据库(1)
数据结构(11)
未归档(37)
软件配置(2)
题解(1)
归档
标签
去牛客网
登录
/
注册
云胡同学的博客
全部文章
/ 算法
(共30篇)
c读入文件,多个字符串,按字典序排序
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ char s[100][100],c[100]={0}; FILE *fp; char l[100]={...
2017-09-21
0
402
HDU2717 Catch That Cow
Problem Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N...
2017-08-30
0
384
POJ1372 Knight Moves
Problem Description A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight ...
2017-08-28
0
491
HDU1548 A strange lift
Problem Description There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every f...
2017-08-28
0
447
POJ3984《迷宫问题》
题目描述 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, }; 它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只...
2017-08-27
0
372
数据结构之冒泡排序
思路 外循环和之前一样,每相邻两个数都比较,最小的就沉在最右边,内循环的范围一次一次减少。 代码,因为一个一个沉下去的就是排好的,相邻元素顺序错误我们就交换。 过程 代码 #include<stdio.h> int main() { int a[100], i, ...
2017-07-22
0
415
堆排序
/构造一个最大堆,然后反着输出去 #include<stdio.h> int h[101]; int n; void swap(int x, int y) { int t; t = h[x]; h[x] = h[y]; h[y] = t; } void s...
2017-07-22
0
348
三位数反转
比如输入123,输出的是321,然后如果是120输出的结果可能不确定,有两种情况 21,省略最前面的0, 021,不省略前面的0. 第一种情况: #include<iostream> using namespace std; int main() { int n; ...
2017-03-05
0
423
7744问题
题目描述 输出所有aabb式的4位完全平方数。千位百位相同,个位十位相同。 思路 总结就是要满足两个条件,第一个是平方数,第二个是要满足aabb式。 代码 先得到aabb式的数,然后开根号的数一定要是整数。 #include<iostream> #include...
2017-03-05
0
567
删数问题 贪心
#include<iostream> #include<string> using namespace std; string N; int s; void find_min_int() { int m = N.size(); if(s >= m) ...
2016-06-26
0
360
首页
上一页
1
2
3
下一页
末页