现在位置: 首页 > slough发表的所有文章
  • 07月
  • 26日
综合 ⁄ 共 1196字 评论关闭
Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-negative. 思路:模拟大数相乘,比较简单。 class Solution { public: string multiply(string num1, string num2) { string s; string sum,tmp; if(num1.length()<=num2.length()) { s = num1; num1 = num2; num2 = s; } int len1 = num1.length(); int len2 = num......
阅读全文
  • 04月
  • 05日
综合 ⁄ 共 527字 评论关闭
#include <cstdio> #include <iostream> #include <cstring> using namespace std; const int maxn = 16; int n,d[1<<maxn],cover[1<<maxn],ALL,a[maxn*2]; int main() { int kase=1; while(scanf("%d",&n)==1&&n){ int ALL = (1<<n) - 1; for(int i=0;i<n;i++){ int m,x; a[i]=(1<<i); scanf("%d",&m); for(int j=1;j<=m;j++){ scanf("%d",&x); a[i]|=(1<<(x)); } ......
阅读全文
  • 03月
  • 30日
综合 ⁄ 共 6451字 评论关闭
【IT168 技术】  无论是在Linux还是在Unix环境中,make都是一个非常重要的编译命令。不管是自己进行项目开发还是安装应用软件,我们都经常要用到make或make install.利用make工具,我们可以将大型的开发项目分解成为多个更易于管理的模块,对于一个包括几百个源文件的应用程序,使用make和makefile工具就可以简洁明快地理顺各个源文件之间纷繁复杂的相互关系。而且如此多的源文件,如果每次都要键入gcc命令进行编译的话,那对程序员来说简直就是一场灾难。而make工具则可自动完成编译工作,并且可以只对程序员在上次编译后修改过......
阅读全文
  • 02月
  • 28日
综合 ⁄ 共 1667字 评论关闭
Sticks Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 105051   Accepted: 23938 Description George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sticks he had originally and how long they were originally. Please help him and design a program which computes the smallest possible original length of those sticks. All lengths expressed in u......
阅读全文
  • 02月
  • 21日
综合 ⁄ 共 2612字 评论关闭
Problem Description Maybe you are familiar with the following situation. You have plugged in a lot of electrical devices, such as toasters, refrigerators, microwave ovens, computers, stereos, etc, and have them all running. But at the moment when you turn on the TV, the fuse blows, since the power drawn from all the machines is greater than the capacity of the fuse. Of course this is a great safety feature, avoiding that houses burn down too often due to fires ignited by overheating wire......
阅读全文
  • 11月
  • 08日
综合 ⁄ 共 2441字 评论关闭
从设计模式的类型上来说,简单工厂模式是属于创建型模式,又叫做静态工厂方法(Static Factory Method)模式,但不属于23种GOF设计模式之一。简单工厂模式是由一个工厂对象决定创建出哪一种产品类的实例。简单工厂模式是工厂模式家族中最简单实用的模式,可以理解为是不同工厂模式的一个特殊实现。 简单工厂模式的UML类图(见下图) 简单工厂模式的实质是由一个工厂类根据传入的参数,动态决定应该创建哪一个产品类(这些产品类继承自一个父类或接口)的实例。 该模式中包含的角色及其职责 工厂(Creator)角色 简单工厂模式......
阅读全文
  • 05月
  • 06日
综合 ⁄ 共 2856字 评论关闭
patch -p0 和patch -p1的区别 今天上QQ的时候发现eva不能用了,后来又看到了解决方法,所以想打个补丁,不过不会:-)。后来查了查明白了,写了个总结,分享一下,也不知道以前有没有这方面的东西,希望我这个不是多余的。 创建补丁文件: 代码: diff -Naur 旧的目录 新的目录 > patch文件 或者 diff -Naur 旧的文件 新的文件 > patch文件 对于目录层数的一些限制 在创建patch的时候文件夹的层数应当是一样的,比如 代码: --- old/modules/pcitableMon Sep 27 11:03:56 1999 +++ new/modules/pcitableTue Dec......
阅读全文
  • 04月
  • 23日
综合 ⁄ 共 2094字 评论关闭
Most Powerful Time Limit: 2 Seconds      Memory Limit: 65536 KB Recently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atoms collide, one of them disappears and a lot of power is produced. Researchers know the way every two atoms perform when collided and the power every two atoms can produce. You are to write a program to make it most powerful, which means tha......
阅读全文
  • 04月
  • 20日
综合 ⁄ 共 2059字 评论关闭
vim是非常强大、可定制的编辑器,但也因此显得难以上手。尤其是对于新手,好不容易将基本的移动、编辑练熟。想定制vim,安装插件时还会遇到更多难以预料的错误而无法解决。博主就是这个情况,深感初学vim之不易。今晚为一台新电脑装vim插件,将备份好的vimrc拷贝到~主文件夹下后。vim启动报警——找不到vundle方法。检查之后,发现是runtimepath 设定有问题,修改之后,顺利加载。下面博主将详细介绍如何安装vim插件。 1. 插件介绍 vim本身就非常强大了,但默认配置和IDE相比,自动补全很麻烦,不能直接加注释......,这样的功能还......
阅读全文
  • 04月
  • 17日
综合 ⁄ 共 3171字 评论关闭
10g New Feature--Collect function   Collect Functio can use in sql query to convert multiple rows of data to a collection of data.  Oracle create a SYS owned type for it.     -->tested it in Walmart Prod Env SQL> select collect(tname) from tab;   select collect(tname) from tab   ORA-20900: User DEV_USER is not allowed to run DDL at any time. ORA-06512: at line 76     From the error message we can see, Oracle try to launch DDL statement after we run the query. What is the DDL? T......
阅读全文
  • 02月
  • 21日
综合 ⁄ 共 2664字 评论关闭
Party at Hali-Bula Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 5418   Accepted: 1920 Description Dear Contestant, I'm going to have a party at my villa at Hali-Bula to celebrate my retirement from BCM. I wish I could invite all my co-workers, but imagine how an employee can enjoy a party when he finds his boss among the guests! So, I decide not to invite both an employee and his/her boss. The organizational hierarchy at BCM is such that nobody has more than o......
阅读全文
  • 02月
  • 16日
综合 ⁄ 共 62字 评论关闭
Android开发之移动互联网周刊第二期 http://www.apkbus.com/zhoukan/2/index.html
阅读全文