自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

许少y

Codes change the world !

  • 博客(19)
  • 资源 (2)
  • 收藏
  • 关注

原创 hihoCoder--1014 Trie树

题意给定一个词典,对于每一个给定的字符串,求以这个字符串开头的所有单词的个数。题解构建Trie树,节点附加一个域cnt,表示以从根到该节点结尾的字符串开头的单词个数。 每次insert一个单词,它经过的每个节点,其cnt都要加1。#include <iostream>#include <cstdio>#include <algorithm>#include <string>#include

2016-12-30 22:06:54 367

原创 Linux--tree命令实现

一个简单的实现。 参考#include <unistd.h>#include <stdio.h>#include <dirent.h>#include <string.h>#include <sys/stat.h>#include <stdlib.h>void printdir(const char* dir, int depth){ DIR *dp; struct di

2016-12-30 20:37:32 1695

原创 PKU--谁是你潜在的朋友

题目描述“臭味相投”——这是我们描述朋友时喜欢用的词汇。两个人是朋友通常意味着他们存在着许多共同的兴趣。然而作为一个宅男,你发现自己与他人相互了解的机会并不太多。幸运的是,你意外得到了一份北大图书馆的图书借阅记录,于是你挑灯熬夜地编程,想从中发现潜在的朋友。 首先你对借阅记录进行了一番整理,把N个读者依次编号为1,2,…,N,把M本书依次编号为1,2,…,M。同时,按照“臭味相投”的原则,和

2016-12-25 15:33:52 459

原创 leetcode--20. Valid Parentheses

20. Valid Parentheses Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.The brackets must close in the correct order, “()” and “()[]

2016-12-24 20:10:47 381

原创 Python--实现密码强度检测器

注:本文内容来源于实验楼–python实现密码强度检测器 课程笔记密码强度密码强度如何量化呢? 一个密码可以有以下几种类型:长度、大写字母、小写字母、数字以及特殊符号。 显然,密码包含的特征越多、长度越长,其强度也就越高。 我们设置几个等级来评测密码强度,分别是:terrible, simple, medium, strong。 不同的应用可能对密码强度的要求不一样,我们引入最小程度(mi

2016-12-23 21:15:43 8706 1

原创 leetcode--27. Remove Element

Remove ElementDescriptionGiven an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with

2016-12-19 21:30:33 375

原创 Python 练习册,每天一个小程序(0002)

第 0002 题:将 0001 题生成的 200 个激活码(或者优惠券)保存到 MySQL 关系型数据库中。# coding: utf-8# 第 0002 题:将 0001 题生成的 200 个激活码(或者优惠券)保存到 MySQL 关系型数据库中。import uuidimport MySQLdbdef generate_code(num): codes = [] i = 0

2016-12-14 15:39:33 856

原创 PAT--1123. Is It a Complete AVL Tree (30)

link题解AVL树的插入,然后判断一下是否为完全二叉树。 题目简单,然而考试的时候没做出来= = 好久没写过平衡树,记不得了,只写了个普通的BST得了可怜的6分。。 基础不牢啊。。务实基础!!!#include <iostream>#include <cstdio>#include <algorithm>#include <vector>#include <queue>#inclu

2016-12-10 21:26:21 760 2

原创 PAT--1122. Hamiltonian Cycle (25)

DescriptionThe “Hamilton cycle problem” is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a “Hamiltonian cycle”.In this problem, you are supposed to tell if a give

2016-12-10 21:18:53 1709 1

原创 PAT--1121. Damn Single (25)

linkDescription“Damn Single (单身狗)” is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of.Input Specification

2016-12-10 21:09:40 569

原创 PAT--1120. Friend Numbers (20)

linkDescriptionTwo integers are called “friend numbers” if they share the same sum of their digits, and the sum is their “friend ID”. For example, 123 and 51 are friend numbers since 1+2+3 = 5+1 = 6, a

2016-12-10 21:06:17 457

原创 PAT--1091. Acute Stroke (30)(三维bfs)

DescriptionOne important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MRI slice, your j

2016-12-10 00:13:21 408

原创 PAT--1076. Forwards on Weibo (30)(图的bfs遍历)

DescriptionWeibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relation

2016-12-09 21:40:52 333

原创 PAT--1060. Are They Equal(字符串处理)

DescriptionIf a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123*105 with simple chopping. Now given the number of

2016-12-09 20:35:56 381

原创 PAT--1099. Build A Binary Search Tree

link题解根据给定的二叉搜索树和插入这棵树的整数值,求其层序遍历。中序遍历二叉搜索树可以得到有序的序列,此题正好相反,将原有序列排好序后中序插入之。#include <iostream>#include <algorithm>#include <vector>#include <cstdio>#include <queue>using namespace std;// remain

2016-12-09 12:00:48 323

原创 PAT--1098. Insertion or Heap Sort(排序)

link题解选择排序和堆排序.#include <iostream>#include <cstdio>#include <algorithm>#include <vector>using namespace std;const int maxn = 100 + 10;vector<int> a, b;int n;int flag;bool insertSort(vector<int>

2016-12-08 17:37:12 421

原创 PAT--1078. Hashing(哈希二次探测)

DescriptionThe task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined to be “H(ke

2016-12-06 21:37:07 378

原创 PAT--1094. The Largest Generation

link题解求一棵树中节点数最大的一层,dfs和bfs皆可。#include <iostream>#include <algorithm>#include <cstdio>#include <vector>#include <map>#include <queue>using namespace std;const int maxn = 100;vector<int> G[maxn];

2016-12-06 15:36:15 223

原创 PAT--1093. Count PAT's (25)

DescriptionThe string APPAPT contains two PAT’s as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th charact

2016-12-03 20:51:07 354

mybatis从入门到精通

mybatis从入门到精通 Mybatis使用之环境搭建 Mybatis使用之简单的增删改查 ...

2018-04-16

蓝桥杯2014年C语言真题

2014年的蓝桥杯C语言试题。 1.啤酒和饮料 2.切面条 3.李白打酒 4.史丰收速算 5.打印图形 6.奇怪的分式 7.六角填数 8.蚂蚁感冒 9.地宫取包 10.小朋友排队

2015-02-02

空空如也

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

TA关注的人

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