现在位置: 首页 > caritas发表的所有文章
  • 11月
  • 04日
综合 ⁄ 共 561字 评论关闭
一、     题目 将罗马数字转换成整型数字。前面已经介绍过罗马数字了这里就不赘述了。 二、     分析 前面的Integerto Roman 已经知道将整型数转换成罗马数字,方面一样我们需要一位位的确定。首先我们一个个的将字母和数字匹配对应,然后我们由以下的规则来思考: 1、重复次数:一个罗马数字重复几次,就表示这个数的几倍。 左加右减: 2、在较大的罗马数字的右边记上较小的罗马数字,表示大数字加小数字。 3、在较大的罗马数字的左边记上较小的罗马数字,表示大数字减小数字。 所以,我们在转换的时候只需要考虑到下一个字母的存......
阅读全文
  • 04月
  • 08日
综合 ⁄ 共 1411字 评论关闭
大意略。 思路: 参考了UVA论坛里的思路: Let f(n) be the number of way to connect the main transmission center (mtc) and n houses. By removing the mtc and its cables to the houses, there will be one or more connected components of houses. Let k be the number of houses of the right most connected component. Then,  1. there are k ways to connect one cable from the mtc to this component, and  2. there are f(n-k) ways to connect the mtc to the rest n-k houses.  So, there are k*f(n-k) to conne......
阅读全文
  • 09月
  • 19日
综合 ⁄ 共 0字 评论关闭
  • 08月
  • 12日
综合 ⁄ 共 2383字 评论关闭
import java.util.List; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.DocumentHelper; import org.dom4j.Element; /**  * XML数据解析类  * @author 李文锴  */ public class XMLOperate {     /**      * 解析XML数据      */     public static void main(String[] args) {         String str = "<?xml version=/"1.0/" encoding=/"UTF-8/"?>" +                 "<orders>" +                 "<order>" +                 "<customer><no>LS-SM-AM-......
阅读全文
  • 06月
  • 08日
综合 ⁄ 共 362字 评论关闭
在ArcGis中把点的属性赋给区 1:在ArcMap中加载点和区层,右击区层,选择“Joins and Relates”-->“Join...”,在弹出的对话框中,第一个下拉框选择“Join data from another layer based on spatial location”,在第二个下拉框选择点层,然后在联接后属性选择第二个单选框,然后选择输出图层名称,点击“OK”。这样区和点就根据空间位置把属性联接上了,但是在Arcgis中,区内即使没有点,也会和最近的点联接上,要想把没有点的区所连接的属性去掉,就根据空间位置选择面图层“completely contain”点图层,这样包含点的那些区就被选中了......
阅读全文
  • 03月
  • 21日
综合 ⁄ 共 3342字 评论关闭
Resilient Distributed Dataset (RDD)弹性分布数据集 ◆ RDD是Spark的最基本抽象,是对分布式内存的抽象使用,实现了以操作本地集合的方式来操作分布式数据集的抽象实现。RDD是Spark最核心的东西,它表示已被分区,不可变的并能够被并行操作的数据集合,不同的数据集格式对应不同的RDD实现。RDD必须是可序列化的。RDD可以cache到内存中,每次对RDD数据集的操作之后的结果,都可以存放到内存中,下一个操作可以直接从内存中输入,省去了MapReduce大量的磁盘IO操作。这对于迭代运算比较常见的机器学习算法, 交互式数据挖掘来说,效率......
阅读全文
  • 02月
  • 17日
综合 ⁄ 共 9267字 评论关闭
最新说明:该接口已失效! 2014-03-04     可申请它公布的API,需申请:http://smart.weather.com.cn/wzfw/smart/weatherapi.shtml 在用Android获取天气预报数据时,大家一定会首先想到Google的天气预报API,其实除了Google的天气预报API,免费的天气预报接口还有http://www.webservicex.net/globalweather.asmx?op=GetWeather、http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx和中央气象台的天气预报,这三个是我最近试过的都可以访问,网上其实还介绍的有www.ayandy.com,不过我没试过 ^_^      现在就来谈一谈这......
阅读全文
  • 02月
  • 04日
综合 ⁄ 共 1255字 评论关闭
虽然批评下属有一定的困难,但并不是要所有的上司都装聋扮哑对待下属。利用适当的批评方法,不单只不伤害下属自尊,也显示你的管理事业逐渐迈向成功。   作为上司批评下属最不当的方式有:   (1)背后批评。你可能刻意或不经意地在某下属面前批评另一个下属的工作能力差,甚至暗示有开除他的可能,这是最小家子气的批评方式。   某下属或会传给其他同事知道,反而被批评的一位仍蒙在鼓里,依然干着错事。直到他听到风声时,已到众人皆知的地步,他的自尊心必然受到打击,无论你所批评的是否合理,他也无意更正,且迁怒于你。......
阅读全文
  • 01月
  • 21日
综合 ⁄ 共 1944字 评论关闭
十字链表是有向图的一种存储方式,它可以看做将有向图的邻接表和逆邻接表结合起来的一种链表.其弧节点及顶点节点结构示意图如下: C语言结构话形式定义: #define MAX_VERTEX_NUM 20 //最多顶点个数 typedef enum{DG,DN,UDG,UDN} GraphKing; //图的种类 typedef int VertexData; //顶点数据类型,根据实际需要更改 typedef struct ArcNode{ //弧的信息 int tailvex; int headvex; struct ArcNode * hlink; struct ArcNode * tlink; }ArcNode; typedef struct VertexNode{ //顶点信息 VertexData ......
阅读全文
  • 01月
  • 17日
综合 ⁄ 共 909字 评论关闭
被秀智商下限了; 直接代码。。 <span style="font-size:24px;">#include<stdio.h> #include<string.h> #include<algorithm> #include<iostream> #include<cmath> using namespace std; int s[55]; double w[120]; int main() { int a,b,i; scanf("%d",&a); while(a--) { scanf("%d",&b); for(i=0;i<b;i++) scanf("%d",&s[i]); sort(s,s+b); int cns=0; for(i=1;i<b;i++) { w[cns]=s[i]-s[i-1]; w[cns+1]=w[cns]/2.0; cns+=2; } sort(w,w......
阅读全文
  • 01月
  • 10日
综合 ⁄ 共 1915字 评论关闭
Android中拍照、图片、录音、视频和音频功能的方法和代码  (2012-06-13 14:22:25) 转载▼ 标签:  it 分类: Android博文精选 Android中拍照、图片、录音、视频和音频功能的方法和代码   //选择图片 requestCode 返回的标识 Intent innerIntent = new Intent(Intent.ACTION_GET_CONTENT); //"android.intent.action.GET_CONTENT" innerIntent.setType(contentType); //查看类型 String IMAGE_UNSPECIFIED = "image/*"; Intent wrapperIntent = Intent.createChooser(innerIntent, null); ((Activity) context).sta......
阅读全文
  • 11月
  • 22日
综合 ⁄ 共 1113字 评论关闭
  How Many Sets II Time Limit: 2 Seconds      Memory Limit: 65536 KB Given a set S = {1, 2, ..., n}, number m and p, your job is to count how many set T satisfies the following condition: T is a subset of S |T| = m T does not contain continuous numbers, that is to say x and x+1 can not both in T Input There are multiple cases, each contains 3 integers n ( 1 <= n <= 109 ), m ( 0 <= m <= 104, m <= n ) and p ( p is prime, 1 <= p <= 109 ) in one line seperated ......
阅读全文