自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 leetcode 4. Median of Two Sorted Arrays

给了两个排好序的数组,如果再去把数组合并排序找中间数肯定超时。这里分别从左端开始比较两个数组,当前个数k=0,i=j=0,如果array1[i]class Solution {public:        double findMedianSortedArrays(vector& nums1, vector& nums2) {            int k=0,i=0,j=

2017-10-23 22:44:01 210

原创 leetcode Add to List 3. Longest Substring

如果直接暴力容易超时,这里采用2个变量i,j表示字符串左和右;如果s[j]是重复的,那么vis[s[i]]--,i向右移动一位。#includeclass Solution {public:    int lengthOfLongestSubstring(string s) {    int i=0,j=0;int maxlen=0;    int vis[266];

2017-10-15 21:29:59 177

原创 关于这次2017-9PAT甲考试的感想

其实考试是真的简单。。。然后我只考了70分,单词好多不认识,最后一题红黑树博主心太大觉得树不会弄这种题目所有根本没有去看过,诶如果稍微看下应该是稳稳的90+的。所以大家也不要太紧张,时间很够的慢慢打,简单题目5分钟绝对打完。下次还要再参加的,大家也一起加油,开始每天更新一种算法吧。

2017-09-18 20:33:38 982

原创 PAT-A-https://www.patest.cn/contests/pat-a-practise/1029

Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 16, 17} is 15. The

2017-08-04 10:22:23 2391

原创 PAT-A-1028. List Sorting (25)

1028. List Sorting (25)时间限制200 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueExcel can sort records according to any colum

2017-08-03 11:33:57 282

原创 PAT-A-1026. Table Tennis (30)

1026. Table Tennis (30)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA table tennis club has N tables available to

2017-08-02 11:03:07 292

原创 PAT-A1027. Colors in Mars (20)

People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 dig

2017-08-02 10:59:50 251

原创 PAT甲1020

1020. Tree Traversals (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueSuppose that all the keys in a binary tree

2017-07-19 10:15:06 223

原创 Pat甲级10019

A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All single digit numbers are palindromic numbers

2017-06-18 21:54:43 285

空空如也

空空如也

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

TA关注的人

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