自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

咸鱼夏の翻身观察记录

吾日三省吾身:敲代码否?敲代码否?敲代码否?

  • 博客(16)
  • 收藏
  • 关注

原创 PAT 1116 Come on! Let's C [逻辑题] [素数判断]

"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun, the award rules are funny as...

2019-05-21 20:53:37 232

原创 LeetCode [栈] 496.Next Greater Element I(C++和Python实现)

496 Next Greater Element I[难度:简单][哈希表/栈]【题目】You are given two arrays(without duplicates)nums1andnums2wherenums1’s elements are subset ofnums2. Find all the next greater numbers fornums1'...

2019-05-18 14:14:20 227

原创 LeetCode [栈] 682.Baseball Game(C++和Python实现)

682 Baseball Game[难度:简单][stringstream:字符串转整数神器]【题目】You're now a baseball game point recorder.Given a list of strings, each string can be one of the 4 following types:Integer(one round's sco...

2019-05-18 14:14:12 192

原创 LeetCode [栈] 844.Backspace String Compare(C++和Python实现)

844 Backspace String Compare [难度:简单] [空间复杂度为1|巧妙运用变量]【题目】Given twostringsSandT,return if they are equal when both are typed into empty text editors.#means a backspace character.Example 1:...

2019-05-17 19:55:13 374

原创 LeetCode [栈] 155.Min Stack(C++和Python实现)

155 Min Stack [难度:简单] [最小栈] (解法很巧妙)【题目】Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack. pop() -- Removes th...

2019-05-17 19:53:25 247

原创 LeetCode [栈] 20.Valid Parentheses (C++和Python实现)

20 Valid Parentheses [难度:简单] [括号匹配]【题目】Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.An input string is valid if:Open br...

2019-05-17 19:51:52 186

原创 LeetCode [链表] 141.Linked List Cycle (C++和Python实现)

141.Linked List Cycle [难度:简单]【题目】Given a linked list, determine if it has a cycle in it.To represent a cycle in the given linked list, we use an integerposwhich represents the position (0-inde...

2019-05-17 19:49:52 170

原创 LeetCode [链表] 234.Palindrome Linked List (C++和Python实现)

234.Palindrome Linked List [难度:简单]【题目】Given a singly linked list, determine if it is a palindrome.Example 1:Input: 1->2Output: falseExample 2:Input: 1->2->2->1Output: true...

2019-05-17 19:48:22 254

原创 LeetCode [链表] 876. Middle of the Linked List (C++和Python实现)

876. Middle of the Linked List [难度:简单]【题目】Given a non-empty, singlylinked list with head nodehead, returnamiddle node of linked list.If there are two middle nodes, return the second middle n...

2019-05-17 19:46:42 293

原创 LeetCode [链表] 206. Reverse Linked List (C++和Python实现)

206. Reverse Linked List [难度:简单]【题目】Reverse a singly linked list.Example:Input: 1->2->3->4->5->NULLOutput: 5->4->3->2->1->NULLFollow up:A linked list can b...

2019-05-17 19:45:04 173

原创 LeetCode [链表] 19.Remove Nth Node From End of List (C++和Python实现)

19.Remove Nth Node From End of List [难度:中等]【题目】Given a linked list, remove then-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n =...

2019-05-17 19:42:41 192

原创 LeetCode [链表] 21.Merge Two Sorted Lists (C++和Python实现)

21.Merge Two Sorted Lists [难度:简单]【题目】Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input...

2019-05-17 19:41:11 169

原创 PAT 1132 Cut Integer [string相关操作] [余数为0的浮点错误]

Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 167334, we have A = 167 and B = 334. It is interesting...

2019-05-17 19:33:34 227

原创 PAT 1136 A Delayed Palindrome [字符串反转] [大整数运算]

Consider a positive integerNwritten in standard notation withk+1digitsa​i​​asa​k​​⋯a​1​​a​0​​with0≤a​i​​<10for allianda​k​​>0. ThenNispalindromicif and only ifa​i​​=a​k−i​​for a...

2019-05-16 20:45:03 201

原创 PAT 1140 Look-and-say Sequence [字符串处理] [模拟]

Look-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, ...whereDis in [0, 9] except 1. The (n+1)st number is a kind of description of the nth n...

2019-05-15 20:08:43 200

原创 PAT 1082 Read Number in Chinese [字符串处理] [数字分位读法]

Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. OutputFufirst if it is negative. For example, -123456789 is read asFu yi Yi er Qian san Bai ...

2019-05-11 20:32:58 317

空空如也

空空如也

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

TA关注的人

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