现在位置: 首页 > Listushipsy发表的所有文章
  • 08月
  • 29日
算法 ⁄ 共 1222字 评论关闭
题意:在[0, 8000]上染色n次,每次染色的区间为[x1, x2],颜色为c,问最后每种颜色有多少段(所有数字在[0, 8000]内)。 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=610 ——>>对于端点x1, x2,对应成区间段[x1+1, x2],接着就染染色,线段树处理一下就好了。。。#^_^ SF了几次,原因:n指染色次数,并非指在区间[0, n]上染色。 #include <cstdio> #include <cstring> using namespace std; #define lc (o<<1) #define rc ((o<<1)+1) const int N = 8000; const int ......
阅读全文
  • 10月
  • 05日
操作系统 ⁄ 共 3571字 评论关闭
Windows(Linux在下面)1.下载安装包boost_1_53_0 http://www.boost.org/users/download/ http://sourceforge.net/projects/boost/files/boost/1.53.0/2.解压缩到d:/boost目录下 3.编译bjam (1)从vs2010的工具菜单进入命令提示窗口(单击“开始”按钮,指向“所有程序”,指向“Microsoft Visua l Stuio 2010”,指向"工具",然后单击“Visual Studio 2010 command prompt(命令提示)” (2)cd到d:/boost/boost_1_53_0下执行bootstrap.bat,然后,会在d:/boost/boost_1_53_0/下生成bjam.exe,4.设定编译环境(加入红色字体) 修改user-......
阅读全文
  • 06月
  • 07日
综合 ⁄ 共 2113字 评论关闭
本文主要通过分析Java内存分配的栈、堆以以及常量池详细的讲解了其的工作原理。 一、Java虚拟机内存原型 寄存器:我们在程序中无法控制栈:存放基本类型的数据和对象的引用,但对象本身不存放在栈中,而是存放在堆中堆:存放用new产生的数据静态域:存放在对象中用static定义的静态成员常量池:存放常量非RAM存储:硬盘等永久存储空间。 二、常量池(constant pool) 常量池指的是在编译期被确定,并被保存在已编译的。class文件中的一些数据。除了包含代码中所定义的各种基本类型(如int、long等等)和对象型(如String及数......
阅读全文
  • 05月
  • 22日
综合 ⁄ 共 532字 评论关闭
jquery trim() 作用是,删除字符串两边出现的空格 // Used for trimming whitespace trimLeft = /^\s+/, trimRight = /\s+$/, // Use native String.trim function wherever possible trim: trim ? function( text ) { return text == null ? "" : trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); }, 分析:jquery trim() 作用是,删除字符串两边出现的空格; 其中的关键实现是......
阅读全文
  • 05月
  • 07日
综合 ⁄ 共 110字 评论关闭
HttpHost proxy = new HttpHost(“ip”, port); httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
阅读全文
  • 04月
  • 26日
综合 ⁄ 共 72字 评论关闭
要安装 .deb 套件包时 sudo dpkg -i package_file.deb 要反安装 .deb 套件包时 sudo dpkg -r package_name  
阅读全文
  • 04月
  • 24日
综合 ⁄ 共 1373字 评论关闭
#include<iostream> #include<cstring> #include<cstdio> #define inf 0x7fffffff using namespace std; inline int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } struct edge{ int to,next,v; }e[500001]; int n,m,cnt=1,ans,T=8001,head[50001],h[50001],to[50001]; bool mark[50001]; void ins(int u,int v,int w){ e[++cnt]=(edge){v,head[u]......
阅读全文
  • 04月
  • 13日
综合 ⁄ 共 3513字 评论关闭
一.题目 Ancient Cipher Time Limit: 1000MS Memory Limit: 65536K Description Ancient Roman empire had a strong government system with various departments, including a secret service department. Important documents were sent between provinces and the capital in encrypted form to prevent eavesdropping. The most popular ciphers in those times were so called substitution cipher and permutation cipher.  Substitution cipher changes all occurrences of each letter to some other letter.......
阅读全文
  • 01月
  • 27日
综合 ⁄ 共 2529字 评论关闭
一、何谓Atomic? Atomic一词跟原子有点关系,后者曾被人认为是最小物质的单位。计算机中的Atomic是指不能分割成若干部分的意思。如果一段代码被认为是Atomic,则表示这段代码在执行过程中,是不能被中断的。通常来说,原子指令由硬件提供,供软件来实现原子方法(某个线程进入该方法后,就不会被中断,直到其执行完成) 在x86 平台上,CPU提供了在指令执行期间对总线加锁的手段。CPU芯片上有一条引线#HLOCK pin,如果汇编语言的程序中在一条指令前面加上前缀"LOCK",经过汇编以后的机器代码就使CPU在执行这条指令的时候把#HLOCK p......
阅读全文
  • 12月
  • 20日
综合 ⁄ 共 1203字 评论关闭
在对hive 进行 select 查询的时候 我们可以编写 python 、php 、c++等脚本来进行相应的数据处理,我们要用到hive  的 TRANSFORM  和  using  看例子: add file /www/FCCS_Data/ComETL/hive/sql_map/demo.py ;  from access_fccs select TRANSFORM (time) using 'python demo.py' where week=41 limit 10 ; 或者: add file /www/FCCS_Data/ComETL/hive/sql_map/demo.py; select TRANSFORM (time) using 'python demo.py' as (time) from (select * from access_fccs where week=41 limit 10) a ; 上面 SQL......
阅读全文
  • 12月
  • 03日
综合 ⁄ 共 777字 评论关闭
最近写程序时候遇到了一个问题,上网查了之后发现这是vc6.0的bug。   继上次发现getline有bug以来,这是第二次了。顿时让我想起某人说的“珍惜生命,远离VC6”,这句话太对了   废话不多说,问题如下代码所示:   #include <iostream> using namespace std; class A { public: A():m(2) { } friend ostream &operator<<(ostream & os,const A &a); private: int m; }; ostream &operator<<(ostream & os,const A &a) { os<<a.m; return os; } int main() { A a; cout<<......
阅读全文
  • 12月
  • 02日
综合 ⁄ 共 1671字 评论关闭
创建新的AVD时 碰到的问题如下图 没有相应的系统镜像 然后SDK运行 指望下载: 可是没有,查后原为和谐之顾,身高羞愧无力翻墙 查到度友 btboy1978提供的链接直接下载 https://dl-ssl.google.com/android/repository/sys-img/android/sysimg_mips-17_r01.zip https://dl-ssl.google.com/android/repository/sys-img/android/sysimg_mips-16_r04.zip https://dl-ssl.google.com/android/repository/sys-img/android/sysimg_mips-15_r01.zip https://dl-ssl.google.com/android/repository/sys-img/android/sysimg_x86-19_r02.......
阅读全文