c++
hamztx
这个作者很懒,什么都没留下…
展开
-
cin问题
string s;while(cin>>s){cout}当输入ss s原创 2014-08-02 21:13:29 · 404 阅读 · 0 评论 -
vector的sort 问题
#include#include#include#includeusing namespace std;struct stu{int mark;string name;int age;};bool cmp(stu a, stu b){return (a.mark}int main(){int n;cin >原创 2014-08-22 00:16:28 · 661 阅读 · 1 评论 -
strtok函数
strtok函数原创 2014-11-02 15:24:32 · 815 阅读 · 0 评论 -
C++笔记
类:类shen原创 2014-10-14 19:57:41 · 335 阅读 · 0 评论 -
4 Median of Two Sorted Arrays
Leetcode 4:There are two sorted arrays A and B 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)).简单的归并排序,将两个已排序的数组合原创 2015-04-19 15:19:24 · 339 阅读 · 0 评论 -
1Two Sum
Leetcode 1: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 targ原创 2015-04-16 15:55:35 · 333 阅读 · 0 评论 -
201 Bitwise AND of Numbers Range
Leetcode201:Given a range [m, n] where 0 For example, given the range [5, 7], you should return 4.m到n之间的所有数之间与,最后的结果应该是二进制数共有的前几位,例如5,6,7二进制分别为101,110,111结果为100,第一位为1其余为0。解题思路即位找到共有的前几位二原创 2015-04-16 10:59:43 · 438 阅读 · 0 评论 -
198 House Robber
Leetcode198:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is tha原创 2015-04-16 10:17:33 · 412 阅读 · 0 评论 -
3 Longest Substring Without Repeating Characters
Leetcode 3:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the le原创 2015-04-17 16:51:02 · 378 阅读 · 0 评论