自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Sunshine

我想去Google

  • 博客(165)
  • 资源 (5)
  • 收藏
  • 关注

原创 模板

题目分析时间复杂度输入ji

2014-07-02 16:37:19 471

原创 PAT系列索引

1003. Emergencyhttp://blog.csdn.net/staibin/article/details/211950611004. Counting Leaveshttp://blog.csdn.net/staibin/article/details/211957511006. Sign I

2014-03-13 23:05:20 563

转载 杭电ACM分类

基础题:1000、1001、1004、1005、1008、1012、1013、1014、1017、1019、1021、1028、1029、1032、1037、1040、1048、1056、1058、1061、1070、1076、1089、1090、1091、1092、1093、1094、1095、1096、1097、1098、1106、1108、1157、1163、1164、1170、1194、1

2014-02-14 11:03:56 619

原创 各种错误

把题目AC了不是最重要的,最重要的是能总结出为什么没有AC!

2014-02-12 18:34:53 800

原创 ACM小技巧

http://www.cnblogs.com/lifeathappiness/p/3530344.html

2014-02-11 10:58:54 531

转载 匈牙利命名法

http://hi.baidu.com/chaosaco/item/68573af2e7dd1610d7ff8ce6   a         Array                                              数组    b         BOOL (int)                                     布尔(整数

2014-02-09 10:53:07 523

原创 Google代码规范之C++

You may need to read in http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml。

2014-07-28 12:57:53 794

原创 Path Sum

path-sum递归:如果使用递归,需要明确递归的结束条件,结束条件分为几类。递归的模式为:Type f(...) {    if 满足结束条件1        return x;    if 满足结束条件2        return x;    ......        递归表达式}

2014-07-28 11:15:30 665

原创 Single Number II

题目Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it wit

2014-07-23 15:31:58 603

原创 Single Number

//空间O(n), 时间O(nlogn)class Solution {public: int singleNumber(int A[], int n) { set se; for (int i = 0; i < n; ++i) { auto it = se.find(A[i]); if (it == s

2014-07-21 22:18:28 607

原创 Linked List Cycle II

题目分析复杂度CODE

2014-07-21 13:48:23 669

原创 Linked List Cycle

题目分析复杂度CODE

2014-07-21 11:51:35 522

原创 Reorder List

题目分析复杂度CODE

2014-07-20 22:46:46 543

原创 Binary Tree Postorder Traversal

CODE见  http://blog.csdn.net/staibin/article/details/37932173  中的后序遍历。

2014-07-18 21:09:15 461

原创 二叉树非递归遍历--迭代

1、先序2、中序3、后序

2014-07-18 16:25:23 785

原创 Binary Tree Preorder Traversal

题目分析复杂度输入CODE/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL)

2014-07-17 11:49:29 464

原创 LRU Cache

题目分析复杂度注意输入

2014-07-17 11:13:18 653

原创 Insertion Sort List

题目CODE/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ typede

2014-07-16 11:22:47 516

原创 单链表C语言实现(Need edition)

CODE:Cyuyan#include #include #include typedef int ElemType;typedef struct _ListNode{ ElemType data; struct ListNode* next;}ListNode;ListNode * initSList();int isEmpty(ListNode *hea

2014-07-11 16:01:53 807

原创 自定义map比较规则及函数调用

参考文章:http://blog.csdn.net/challenge_c_plusplus/article/details/7429963#include #include #include #include using namespace std;bool my_compare(const string &str1, const string &str2){ retu

2014-07-04 15:23:04 1732

原创 Max Points on a Line

题目分析

2014-07-04 14:39:11 630

转载 指针和指针的引用及双指针

原文链接: http://blog.csdn.net/ztz0223/article/details/1628669

2014-07-03 22:23:47 728

原创 Evaluate Reverse Polish Notation

题目Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2

2014-07-02 16:47:24 414

原创 Reverse Words in a String(Need edition)

题目分析输入shi

2014-07-02 08:53:09 547

原创 Median of Two Sorted Arrays(Need edition)

题目分析方案

2014-07-01 10:47:17 535

原创 Two Sum

题目Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the tar

2014-07-01 10:35:14 592

原创 1075. PAT Judge

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1075/* * 最后一个测试点错误原因:对成绩初始化时,错误。。。见具体代码处解释 * * 需要解决的几个问题: * 1. student应包含哪些成员,什么类型 * 2. 如何实现排序 * 3. 输入的成绩如何映射到student上,显然Hash。 * 本次使用vec

2014-03-21 23:12:26 994

原创 1071. Speech Patterns

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1071/* * map:自动创建机制。 * transform:将某操作应用于指定范围的每个元素,类似于foreach。 * 定义在头文件algorithm中。 * ::tolower:将一个字符大写变小写。 */ #pragma warning(disable: 4786)

2014-03-21 23:11:12 828

原创 1070. Mooncake

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1070/* * 贪心问题 * 坑:数量为double。这样符合实际问题,但是题目给的示例及题目信息尾 * 表明为double。 */#include #include #include using namespace std;struct Mooncake{ dou

2014-03-21 22:12:07 724

原创 1067. Sort with Swap(0,*)

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1067/* * 参考:http://biaobiaoqi.me/blog/2013/10/08/pat-1065-pat-1068/ * * 分析示例、找准方法: 把问题抽象为圈。 * dfs,并查集都可计算圈内元素个数。因此题结构简单,适合用dfs思想。 * 设一个圈有m个元素

2014-03-21 22:10:26 633

原创 1066. Root of AVL Tree

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1066考察AVL树的操作,大家从理论上都懂得过程,但实现起来。。。不知道怎么下手啊/* * 参考:http://biaobiaoqi.me/blog/2013/10/08/pat-1065-pat-1068/ * * 考察AVL树的建立,调整操作,树的高度的更新。 * 需特别注

2014-03-21 22:09:15 638

原创 1064. Complete Binary Search Tree

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1064按正常思路,重点仍在建树,需要结合完全二叉树与二叉搜索树的性质,确定跟节点的位置。另外,其他思路见代码注释。/* * 参考:http://biaobiaoqi.me/blog/2013/08/31/pat-1061-pat-1064/ * * 使用数组存放完全二叉树,

2014-03-21 22:07:17 682

原创 1063. Set Similarity

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1063使用set,简单数学题。// set::find()找不到时返回的是set::end()//#pragma warning(disable: 4786)#include #include #include #include #include #include

2014-03-21 08:51:03 623

原创 1062. Talent and Virtue

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1062德才论:按给定分类,然后进行排序。// 典型分类排序题#include #include #include #include #include #include #include #include #include #include #include #

2014-03-21 08:47:44 688

原创 1060. Are They Equal

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1060转为科学计数法:输入没有固定格式,适合用char,读取一个字符,处理一个。 string适合输入格式固定,比如1073,科学计算表示。参考了newer的源码:http://blog.csdn.net/newner/article/details/9263993。

2014-03-21 08:43:25 584

原创 1059. Prime Factors

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1059// 注意输入数据为1时特殊处理// 采取常规方法,先求出“所有”素数,再一次遍历。// 符合条件者入vector,最后输出。// #include #include #include #include #include #include #include #

2014-03-21 08:21:13 625

原创 1053. Path of Equal Weight

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1053同一类型:路径长度、保存与给定值相同的路径长度、记录一定深度的路径、记录节点号/值。// 采用邻接表表示树// 用vector存储路径// 路径不止1一条,需用vector >存储所有路径// 输入时建树// 得到一个节点的所有子节点后,进行排序:按权值// dfs遍历

2014-03-21 08:14:05 710

原创 1052. Linked List Sorting

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1052这个题目告诉我们:读题、理解题目、分析题目很重要。题目说只有1个链表了吗?题目说链表的结尾一定是NULL了吗?链表空的时候应该输出什么?另外,都注意到NULL定义为-1了。这个题目用hash的方法,很适合的。因此也可以试着用map。数组hash的方法见:

2014-03-19 22:02:01 744

转载 1051. Pop Sequence

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1051栈的操作的检验// 孙佰贵#include #include #include using namespace std;int main(){ int M, N, K; scanf("%d%d%d",&M,&N,&K); for (int i = 0; i

2014-03-19 21:48:44 562

原创 1048. Find Coins

题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1048查询#include #include #include using namespace std;vectorcoin;int n, m;int FindBest(int i){ int l=i+1, r=coin.size()-1; while(l <=

2014-03-19 21:45:37 709

国密SM3算法Golang实现

这是国密SM3算法的Golang实现,其中包括了测试,和一些Debug信息。

2016-08-27

ACM搜索算法:DFS+BFS+A*及动态规划

1.包含了8个文档。 2.大部分为集训队文档。 3.部分算法详解文档。 4.文库搜索,全部下载需要十几分。

2014-03-03

上机100题(二级C语言考试,有答案)

丰富的二级资料,祝你轻松过关,无忧无虑。

2011-04-16

全国二级c语言考试题型

这里有许多二级的题型,是考试前的不错复习提纲,对考试有帮助。

2011-04-16

C++详细精解初学最动力

这本电子文档对初学者不错,讲解精细。 文档非本人整理,只供大家学习。

2011-04-16

空空如也

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

TA关注的人

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