首页 > 其他
FZU 2082 树链剖分
Problem 2082 过路费 Accept: 111    Submit: 455 Time Limit: 1000 mSec    Memory Limit : 32768 KB Problem Description 有n座城市,由n-1条路相连通,使得任意两座城市之间可达。每条路有过路费,要交过路费才能通过。每条路的过路费经常会更新,现问你,当前情况下,从城市a到...
分类:其他   时间:2014-03-02 07:30:07    收藏:0  评论:0  赞:0  阅读:497
SPOJ 375 树链剖分
SPOJ Problem Set (classical) 375. Query on a tree Problem code: QTREE You are given a tree (an acyclic undirected connected graph) with N nodes, and edges numbered 1, 2, 3...N-1. We will ask...
分类:其他   时间:2014-03-02 09:43:41    收藏:0  评论:0  赞:0  阅读:545
UVA - 11270 Tiling Dominoes
题意:用2*1的方块将n*m的矩形铺满的方法 思路:轮廓线动态规划的经典题目:从左到右从上到下将矩阵划分成若干个阶段,每个阶段有2^m个节点,每个(i,j)又有:不放,竖着放,横着放三个情况,接下来就是状态转移 #include #include #include #include using namespace std; const int MAXN = 11; long long...
分类:其他   时间:2014-03-02 11:26:44    收藏:0  评论:0  赞:0  阅读:517
CareerCup Divide n cakes to k different people
In a party there are n different-flavored cakes of volume V1, V2, V3 ... Vn each. Need to divide them into K people present in the  party such that  - Each member of party gets equal volume of cak...
分类:其他   时间:2014-03-02 08:54:34    收藏:0  评论:0  赞:0  阅读:402
替换空格
/********************************************************** 题目:请实现一个函数,把字符串中的每个空格替换成"%20"。 输入"We are happy.",则输出"We%20are%20happy."。 **********************************************************/ #inclu...
分类:其他   时间:2014-03-02 10:45:13    收藏:0  评论:0  赞:0  阅读:486
libgdx基本使用——舞台与演员
除了FirstGame以外的类的代码,都是和之前的博客一样的。。。 package com.doodle.rdemo1; import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic...
分类:其他   时间:2014-03-02 08:06:53    收藏:0  评论:0  赞:0  阅读:581
分数求和
分数求和 时间限制: 1 Sec  内存限制: 128 MB 提交: 256  解决: 29 [提交][状态][讨论版] 题目描述 求两分数相加,输出结果。 输入 题目有多组测试数据,直到文件尾。 每组测试数据需要输入4个整数: nume1, deno1为第一个数的分子和分母, nume2, deno2为第二个数的分子和分母。 输出 两分...
分类:其他   时间:2014-03-02 11:20:31    收藏:0  评论:0  赞:0  阅读:637
eclipse4.2配置tomcat+jdk
window——>preforences——>server——>Runtime Environment——>add——>选择相应tomcat并在jre选择框中选择jdk版本...
分类:其他   时间:2014-03-02 09:42:11    收藏:0  评论:0  赞:0  阅读:281
NYOJ589 糖果
原题链接 很有意思的一道题,刚看题的时候觉得很难,但是仔细一想会发现规律,即找到个数最多的糖果max,只要max小于等于剩下的素有糖果数量+1就Yes,都则No. #include #include int main(){ int t, n, s, *a, max; scanf("%d", &t); while(t-- && scanf("%d", &n)){ a = ...
分类:其他   时间:2014-03-02 11:58:58    收藏:0  评论:0  赞:0  阅读:403
UVA 10729 - Treequivalence(暴力枚举)
Problem C: Treequivalence The following grammar describes a textual notation for a tree with (not necessarily unique) vertex labels: tree ::= label tree ::= label ( subtrees ) subtrees ::= ...
分类:其他   时间:2014-03-02 11:25:15    收藏:0  评论:0  赞:0  阅读:581
%date:~0,4%和 %time:~0,2%字符截取操作用法
那么如下的各个操作的意义如下: %date:~0,4% 表示从左向右指针向右偏0位,然后从指针偏移到的位置开始提取4位字符,结果是2014(年的值) %date:~5,2% 表示指针从左向右偏移5位,然后从偏移处开始提取2位字符,结果是03(月的值)...
分类:其他   时间:2014-03-02 08:53:04    收藏:0  评论:0  赞:0  阅读:459
NYOJ590 相同的和
原题链接 暴力枚举。 #include #include int main(){ int n, m, *a, i, j, count, t; while(scanf("%d%d", &n, &m) == 2){ count = 0; a = (int *)malloc(sizeof(int) *n); for(i = 0; i != n; ++i) scanf("%...
分类:其他   时间:2014-03-02 11:12:49    收藏:0  评论:0  赞:0  阅读:448
SSH Chinese code chaos (SSH中文乱码)-虚拟机
problem:install linux every time.if you use SSH software to link linux, SSH will show chinese words chaos. solve:1.open /etc/sysconfig/i18n 2.change data 问题:每次安装linux,用SSH连接,中文显示乱码。 解决:一、 1....
分类:其他   时间:2014-03-02 10:28:09    收藏:0  评论:0  赞:0  阅读:500
libgdx的基本使用——演员与演出
直接贴本demo的核心代码,如果有什么不明白的,请参考前面的博客 package com.doodle.rdemo3; import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.g...
分类:其他   时间:2014-03-02 11:51:19    收藏:0  评论:0  赞:0  阅读:469
uva 12235 - Help Bubu(dp)
题目链接:uva 12235 - Help Bubu 题目大意:给出n和k,表示说书架上有n本书,可以取出k次书,每次取出后可以任意放回书架中,书的编号为25~32八种,定义该书架的混乱程度为片段的个数。求出最小的混乱度。 解题思路:dp[i][j][s][x],表示说在第i本书的时候,取出了j本书后,s剩下的书(二进制),x最后一本书的编号的情况下混乱度最小值。 状态转移方...
分类:其他   时间:2014-03-02 11:49:47    收藏:0  评论:0  赞:0  阅读:419
1.在使用new创建数组后,此时数组还是一个引用数组。 只有再创建新的对象,并把对象赋值给数组引用,到此初始化结束2.什么是引用类型?
public class swap { public static void main(String[] args) { int[] a=new int[2]; a[1]=12;////基本数据类型new 之后,通过赋值语句来传值 swap[] s = new swap[5]; int i = 0; while (i s[i++] = new swap(); //1. 在Java...
分类:其他   时间:2014-03-02 11:48:16    收藏:0  评论:0  赞:0  阅读:681
NYOJ593 Take it easy
原题链接 #include int main(){ int n, a[10], i; while(scanf("%d", &n) == 1){ for(i = 0; i != 10; ++i) scanf("%d", &a[i]); for(i = 0; i != 10; ++i){ if(n == 0) break; n += a[i]; ...
分类:其他   时间:2014-03-02 09:20:42    收藏:0  评论:0  赞:0  阅读:459
TreeSet(有序集合)对Comparable元素的排序(或使用Comparator)与元素equals方法的关系
这是一个非常基础的问题,但是实际编程中还是比较容易被忽视而导致一些看似奇怪的bug,本文对该问题进行一个小结。我们知道,Set集合的维护的元素是唯一的,不会出现两个一样的元素,这是通过元素的equals和hashCode方法来判定的。而对于TreeSet来说,它本身除了是一个Set集合,同时还会依据一个Comparator或是Comparable接口对元素进行排序。我们就以Comparable的c...
分类:其他   时间:2014-03-02 08:50:00    收藏:0  评论:0  赞:0  阅读:421
调用COM方法
请先引用Microsoft.Office.Interop.Word.dll 调用Word里的拼写检查方法,注意需要先安装了Word. CODE: using System; using System.Reflection; using Microsoft.Office.Interop.Word; namespace CsStudy { class Pro { ...
分类:其他   时间:2014-03-02 08:25:30    收藏:0  评论:0  赞:0  阅读:460
USACO 3.3 Home on the Range (range)
/* Main idea 这道题可以动态规划。二维的动态规划。 状态定义:G[i][j]为以(i,j)为左上角顶点的正方形的最大边长。 边界条件:G[i][j]为初始读入的矩阵。 状态转移方程: G[i][j]=min{ G[i+1][j] , G[i][j+1] , G[i+1][j+1] } + 1; 解析: G[i+1][j] , G[i][j+1] , G[i+1][j+1]分别为(i,j...
分类:其他   时间:2014-03-02 08:48:29    收藏:0  评论:0  赞:0  阅读:533
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!