现在位置: 首页 > fWCUzvKapP发表的所有文章
  • 04月
  • 24日
综合 ⁄ 共 1267字 评论关闭
zky学长不止一次说分层图很简单随便看看就会了 然后今天就拿出时间来学了学分层图(写这篇文章是不是会被骂傻叉算了反正我就是傻叉) 首先@出一篇论文 2004国家集训队《分层图思想及其在信息学竞赛中的应用》肖天 正文时间 ————————————我是分割线>w<—————————————— 裸的最短路和网络流题目大家都会,就算是需要把模型抽象分析一下才能得出也已经不算什么了 但是如果在最短路和网络流的基础上加入一些干扰操作呢? 比如我们可以进行一些操作让图中某些边的边权或者容量减半(beijingwc2012 冻结)而这些操作不是预先......
阅读全文
  • 12月
  • 13日
综合 ⁄ 共 352字 评论关闭
print '\n'.join( [' '.join([ '%d*%d=%d' %(y,x,x*y) for y in range(1,x+1)]) for x in range(1,10)]) output: d||d 1*1=1 1*2=2 2*2=4 1*3=3 2*3=6 3*3=9 1*4=4 2*4=8 3*4=12 4*4=16 1*5=5 2*5=10 3*5=15 4*5=20 5*5=25 1*6=6 2*6=12 3*6=18 4*6=24 5*6=30 6*6=36 1*7=7 2*7=14 3*7=21 4*7=28 5*7=35 6*7=42 7*7=49 1*8=8 2*8=16 3*8=24 4*8=32 5*8=40 6*8=48 7*8=56 8*8=64 1*9=9 2*9=18 3*9=27 4*9=36 5*9=45 6*9=54 7*9=63 8*9=72 9*9=81
阅读全文
  • 05月
  • 17日
综合 ⁄ 共 1508字 评论关闭
转载自:http://www.williamlong.info/archives/2442.html  Google公司今天在美国举行Chrome相关产品发布会,发布会上正式发布谷歌浏览器应用商店(Chrome Web Store)和Chrome OS操作系统。   Google推出的应用商店Chrome Web Store是互联网开放平台应用的一个典型案例,该应用商店提供各种适用于Chrome和Chrome OS的应用程序,目标用户群为1.2亿Chrome浏览器用户,开发者可以在Chrome应用程序商店销售自己的应用程序,并获得收入。Chrome用户则使用Google帐号登录应用商店,并使用Google Checkout付费。   Chrome Web ......
阅读全文
  • 05月
  • 16日
综合 ⁄ 共 889字 评论关闭
每次读、每次忘,Mark一下以后忘记就不翻书了! Maven有三套相互独立的生命周期,分别是:clean、default、site。         clean主要是清理项目。         default是Maven最核心的的构建项目。         site是生成项目站点。 生命周期包含阶段如下: clean周期:  pre-clean:准备清理  clean:真正的清理工作  post-clean:执行清理后的一些后续工作  default周期:  validate:验证  initialize:初始化配置  generate-sources:生成源代码编译目录  process-sources:处理项目主资源文件,复制资源文件到outputclasspath  gene......
阅读全文
代码如下,过了测试数据。 记忆化dp 注意visit[a][b][tag]记录是否之前到达了当前的状态,如果到达过,说明进入了一个环,回溯。 注意回溯的时候,不要设置res[a][b][tag],因为该结果可能尚未产生。 #include<vector> #include<iostream> #include<string.h> using namespace std; // -1: alice win, 1: bob win, -2: inited int res[100][100][2];//[a][b][if a go now] bool visit[100][100][2]; // -1: alice win, 1: bob win // a_f: if alice go now int dfs(vector<vector<int> > &t......
阅读全文
  • 04月
  • 09日
综合 ⁄ 共 4680字 评论关闭
 1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=currentTime.Month; 1.4 取当前日 int 日=currentTime.Day; 1.5 取当前时 int 时=currentTime.Hour; 1.6 取当前分 int 分=currentTime.Minute; 1.7 取当前秒 int 秒=currentTime.Second; 1.8 取当前毫秒 int 毫秒=currentTime.Millisecond; (变量可用中文)  1.9 取中文日期显示——年月日时分 string strY=currentTime.ToString("f"......
阅读全文
  • 04月
  • 04日
综合 ⁄ 共 611字 评论关闭
弄了n年,终于弄出了个并查集的模板。贴上备忘。 简易版。 #include <stdio.h> #include <string.h> #define CLR(a,v) memset(a,v,sizeof(a)) #define N 50010 int pre[N]; void Init() { CLR(pre,-1); } int Root(int x) { return pre[x]+1 ? pre[x] = Root(pre[x]) : x; } void Union(int a,int b) { int r1 = Root(a); int r2 = Root(b); if(r1 != r2) pre[r1] = r2; } 完整版。 #include <stdio.h> #include <string.h> #define CLR(a,v) memset(a,v,sizeof(a)) #define......
阅读全文
  • 03月
  • 31日
综合 ⁄ 共 224字 评论关闭
setOnItemClickListener有时不响应,实际上是当ListView的item中含有checkbox, button等控件时,会导致setOnItemClickListener不响应,解决办法有两种: 1. 将checkbox, button的focusable设置为false; 2. 在getView中,设置convertView接收点击事件:convertView.setOnClickListener; 总之,只要大家注意了这点,就OK啦。
阅读全文
  • 01月
  • 25日
综合 ⁄ 共 2971字 评论关闭
在使用传统的JDBC连接数据库的时候,总是需要这一句(以MySQL为例): Class.forName("com.mysql.jdbc.Driver");    以前我也没深究,只是看网上的例子都这么写,实际上也跑通了,于是便懒得去管内部原理。不过大概还是清楚的,知道这句话是向DriverManage注册了一个MySQL的JDBC Driver。 但为什么要用Class.forName这样看上去不是很优雅的方式呢? 网上还流传了一个这样的版本Class.forName("com.mysql.jdbc.Driver").newInstance(),似乎有点儿多此一举。 经过实验,我发现用com.mysql.jdbc.Driver driver = new com.mysql.jdbc......
阅读全文
  • 12月
  • 22日
综合 ⁄ 共 1117字 评论关闭
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy of the list. /** * Definition for singly-linked list with a random pointer. * struct RandomListNode { * int label; * RandomListNode *next, *random; * RandomListNode(int x) : label(x), next(NULL), random(NULL) {} * }; */ class Solution { public: void duplicateList(RandomListNode* head) { if(head==NULL)return; Ra......
阅读全文
  • 12月
  • 17日
综合 ⁄ 共 5506字 评论关闭
我们都知道在onCreate()里面获取控件的高度是0,这是为什么呢?我们来看一下示例: 首先我们自己写一个控件,这个控件非常简单: [java] public class MyImageView extends ImageView {        public MyImageView(Context context, AttributeSet attrs) {          super(context, attrs);      }      public MyImageView(Context context) {          super(context);      }            @Override      protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {          super.onMeasure(widthMeasureSpec, heigh......
阅读全文
  • 12月
  • 06日
综合 ⁄ 共 168字 评论关闭
注册表 Windows Registry Editor Version 5.00[HKEY_CURRENT_USER/Software/Classes/MIME/Database/Content Type/text/vnd.wap.wml]"CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}" 最好 注销一下
阅读全文