自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 5. Longest Palindromic Substring

方法#1 (围绕中心扩展)注意到回文字符串是围绕中心对称的。当长度为奇数时时以中间字符为轴,长度为偶数时以中间缝隙为轴。设字符串s , j 为某字符的索引。以 s[j] 为中心向两边扩展时,如果 s[j+1]==s[j] , j++,相当于变为长度为偶数的扩展 。string longestPalindrome(string s){ if(s.size()<=1) return

2018-04-05 20:45:29 129

原创 1.操作系统的启动

一些概念:扇区:计算机读取硬盘的时候,不是一个字节一个字节的读取,而是一次读取512字节。每512个字节就称为一个扇区。启动程序IPL:操作系统的大小远超过512个字节,而且不固定。所以在硬盘的第一个扇区中放入一个启动程序,其主要作用就是加载硬盘中的操作系统到内存。这个启动程序就是BootLoader。几乎所有的操作系统都把加载自己的程序放在硬盘的第一个扇区。BIOS:基本IO处理系统程序,开始时...

2018-04-04 19:01:13 402

原创 4. Median of Two Sorted Arrays(二分查找)

Description:There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Discuss:参考本题排名第一的...

2018-04-03 23:13:49 3671

原创 PAT 1114 Family Property (并查集)

#include&lt;iostream&gt;#include&lt;algorithm&gt;#include&lt;vector&gt;#include&lt;set&gt;using namespace std;#define m 10000int road[m],n;struct item{//先合并item,才能统计 int id,h,area;}d[1010];i...

2018-03-10 23:30:27 188

原创 PAT 1045. Favorite Color Stripe (动态规划)

#includeusing namespace std;#define m 210int dp[m]={0};//以colorindex结尾的,最长的序列的长度int index[m]={0};//color在color sequence中的索引int main(){ int n,k,lim,t,ans=0; cin>>lim>>k; for (int i = 1; i <= k;

2018-03-10 15:56:06 164

空空如也

空空如也

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

TA关注的人

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