- 博客(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 241
原创 leetcode Add to List 3. Longest Substring
如果直接暴力容易超时,这里采用2个变量i,j表示字符串左和右;如果s[j]是重复的,那么vis[s[i]]--,i向右移动一位。 #include class Solution { public: int lengthOfLongestSubstring(string s) { int i=0,j=0; int maxlen=0; int vis[266];
2017-10-15 21:29:59 192
原创 关于这次2017-9PAT甲考试的感想
其实考试是真的简单。。。然后我只考了70分,单词好多不认识,最后一题红黑树博主心太大觉得树不会弄这种题目所有根本没有去看过,诶如果稍微看下应该是稳稳的90+的。所以大家也不要太紧张,时间很够的慢慢打,简单题目5分钟绝对打完。下次还要再参加的,大家也一起加油,开始每天更新一种算法吧。
2017-09-18 20:33:38 1013
原创 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 2416
原创 PAT-A-1028. List Sorting (25)
1028. List Sorting (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Excel can sort records according to any colum
2017-08-03 11:33:57 293
原创 PAT-A-1026. Table Tennis (30)
1026. Table Tennis (30) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A table tennis club has N tables available to
2017-08-02 11:03:07 322
原创 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 265
原创 PAT甲1020
1020. Tree Traversals (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Suppose that all the keys in a binary tree
2017-07-19 10:15:06 238
原创 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 317
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人