因为用的时Ubuntu略低版本的,不想更新版本,但是经常更新内核和其他软件,尤其是最近自己更新python,但是软件更新救出错了,而且不能打开“Languae Support”(软件支持)和ibus输入法,非常烦恼,尝试了很多解决方法,但是都不行,只能再改回来了。改回步骤如下:改回以前的python...
分类:
编程语言 时间:
2014-06-25 22:09:20
阅读次数:
318
class Solution {public: int maxProfit(vector &prices) { int len = prices.size(); if (len < 1) return 0; int sum = 0; in...
分类:
其他好文 时间:
2014-06-24 11:28:47
阅读次数:
193
??
所谓临时对象就是一种无名对象。它的出现如果不在程序员的预期之下(例如任何pass by value操作都会引发copy操作,于是形成一个临时对象),往往照成效率上的负担。但有时候可以制造一些临时对象,却又使程序干净清爽的技巧。刻意制造临时对象的方法是,在型别名称之后直接加一对小括号,并可指定初值,例如int(8),其意义相当于调用相应的constructor,且不指定对象名称。STL最...
分类:
编程语言 时间:
2014-06-22 21:01:55
阅读次数:
209
实现vector容器的思路等同于实现一个动态数组,下面我们参照源码的相关资料,给出一个vector容器的大致框架,只有声明,没给出具体的实现。...
分类:
其他好文 时间:
2014-06-22 19:46:40
阅读次数:
128
vector strsplit(const string& str)
{
vector vec;
string sstr1=str, sstr2="";
size_t np=0;
while (sstr1!="")
{
size_t dt = sstr1.find(',');
if (dt != string::npos)
{
sstr1 = str.substr(np...
分类:
其他好文 时间:
2014-06-22 18:06:11
阅读次数:
205
模式匹配的实现,'?'代表单一字符,'*'代表任意多的字符,写代码实现两个字符串是否匹配。
Implement wildcard pattern matching with support for '?' and '*'.、
'?' Matches any single character.
'*' Matches any sequence of characters (inclu...
分类:
其他好文 时间:
2014-06-22 16:40:44
阅读次数:
225
11488 - Hyper Prefix Sets
Time limit: 2.000 seconds
#include
#include
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 5000000;
vector vs;
int cnt,ans...
分类:
其他好文 时间:
2014-06-22 16:38:22
阅读次数:
199
转发:大海巨浪Java库本身就有多种线程安全的容器和同步工具,其中同步容器包括两部分:一个是Vector和Hashtable。另外还有JDK1.2中加入的同步包装类,这些类都是由Collections.synchronizedXXX工厂方法。同步容器都是线程安全的,但是对于复合操作,缺有些缺点:① ...
分类:
编程语言 时间:
2014-06-22 12:54:50
阅读次数:
319
public member function
std::vector::vector
C++98
C++11
default (1)
explicit vector (const allocator_type& alloc = allocator_type());
fill (2)
explicit vec...
分类:
其他好文 时间:
2014-06-22 07:02:06
阅读次数:
386