- 博客(11)
- 收藏
- 关注
原创 HDU 2717 Catch That Cow
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 ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,00
2017-04-02 20:07:50
548
原创 HDU 1372Knight Moves
A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given set of n squares on a chessboar
2017-04-02 19:25:14
466
原创 HDU1548 A strange lift
马上蓝桥杯了,找了些bfs的题目练练手,因为作死报的java组,实在是有些惶恐 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 floor.The lift have just two butt
2017-04-02 18:15:51
509
原创 牛客网剑指offer-03从头到尾打印列表
输入一个链表,从尾到头打印链表每个节点的值。 直接访问链表啊,能有什么问题,然后就RE了,基本功不扎实class Solution {public: vector<int> printListFromTailToHead(ListNode* head) { vector<int> P; while(head->next!=NULL){
2017-03-14 14:10:51
411
原创 牛客网剑指offer-02替换空格
请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。 自己想了一下,感觉没什么思路,就暴力扫描一遍,遇到空格flag记下来,然后把原来的字符串一个一个字符的贴上去,看C++代码class Solution {public: void replaceSpace(char *str,int
2017-03-14 13:38:26
807
原创 牛客网剑指offer-01二维数组的查找
题目描述 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 一上来就想到用二分,后来看了大神们的代码,觉得自己还是太菜了。 只要从左下角往上或者右边看,上面的都比这个数小,下面的都比这个数大,所以直接与目标比较,比目标大,指针上移,比目标小,指针下移,和目标一样就返回true
2017-03-14 12:05:52
900
原创 [Offer收割]编程练习赛9 B题 水陆距离
题目2 : 水陆距离 时间限制:10000ms 单点时限:1000ms 内存限制:256MB描述给定一个N x M的01矩阵,其中1表示陆地,0表示水域。对于每一个位置,求出它距离最近的水域的距离是多少。 矩阵中每个位置与它上下左右相邻的格子距离为1。 输入第一行包含两个整数,N和M。以下N行每行M个0或者1,代表地图。数据保证至少有1块水域。对于30%的数据,1 <= N, M <= 1
2017-03-12 21:40:16
762
原创 图像处理入门<1>——matlab数字图像处理基本操作
环境:mac os 11.7 上 matlab2015 1.基本读入,读出操作I=imread('lena.jpg') %读入当前工作目录下lena图imshow(I) %显示读入图像imwrite(I,'/Users/zhouhang/Documents/MATLAB/lena2.jpg') %写图像2.图像常常需要使用灰度图像进行处理,将图像进行灰度化处理函数rgb2gray
2016-10-21 15:15:14
7378
原创 Codeforces Round #372 (Div. 2)A. Crazy Computer
A. Crazy Computer time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outputZS the Coder is coding on a crazy computer. If you don’t type in a
2016-09-22 11:04:08
365
原创 Codeforces Round #326 (Div. 2)B. Duff in Love
B. Duff in Lovetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuff is in love with lovely numbers! A positive integ
2015-10-16 11:04:41
1078
原创 Codeforces Round #326 (Div. 2) A. Duff and Meat
A. Duff and Meattime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuff is addicted to meat! Malek wants to keep her hap
2015-10-16 10:30:30
2517
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人