自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(51)
  • 资源 (1)
  • 收藏
  • 关注

原创 Redis缓存相关问题

Redis缓存相关问题1 缓存穿透  缓存穿透是指查询一个数据库一定不存在的数据.正常使用Redis缓存的流程大致是:数据查询首先进行缓存查询如果数据存在则直接返回缓存数据如果数据不存在,就对数据库进行查询,并把查询到的数据放进缓存如果数据库查询数据为空,则不放进缓存  如果有人恶意查询数据库中不存在的数据,就会对数据库造成压力,甚至压垮数据库,解决该问题的方法为:  如果从...

2020-01-04 14:05:45 119

原创 使用JasperReports生成PDF报表

1. JasperReports原理jrxml:报表填充模板,本质是一个xml文件jasper:由jrxml模板编译成的二进制文件,用于代码填充数据jrprint:当用数据填充完jasper后生成的对象,用于输出报表2. 制作报表模板2.1 模板设计器jaspersoft studio2.1.1 软件下载下载地址:https://community.jasperso...

2020-01-03 21:21:13 1336

原创 java_自定义异常

自定义异常格式:public class 异常类名 extends Exception { 无参构造 带参构造}实例:首先自定义一个分数异常类 ScoreExceptionpublic class ScoreException extends Exception { public ScoreException() { } public Scor...

2019-09-02 16:38:34 545 1

原创 hdoj 1269 迷宫城堡(Kosaraju算法、Tarjan算法和Gabow算法(暂无))

图的强连通求解->Kosaraju算法    1.对原图G进行深度优先遍历,记录每个点的离开时间放入栈中。    2.选栈顶元素,对反图GT进行遍历,删除能够遍历到的点,这些点构成一个强连通分量。    3.若还有顶点没有被删除,循环 步骤2,否则算法结束#include<bits/stdc++.h>using namespace std;int n,m,s;int st...

2018-05-02 21:24:45 211

原创 hdoj 1113 Word Amalgamation(字符串匹配)

Word AmalgamationProblem DescriptionIn millions of newspapers across the United States there is a word game called Jumble. The object of this game is to solve a riddle, but in order to find the letter...

2018-04-13 10:58:57 234

原创 hdoj 1022 Train Problem I

Train Problem IProblem DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train...

2018-04-07 21:01:50 102

原创 hdoj 1124 Factorial

Factorial题目含义:计算N!末尾有多少个 0。Sample Input63601001024234568735373 Sample Output0142425358612183837末尾为零必定是2*5=10,且2的因子数必定大于5的因字数。算术基本定理中n!的素因子分解中的素数p的幂为[n/p]+[n/p²]+[n/p³]+……#include<cstdio&...

2018-04-04 17:18:06 138

原创 hdoj 2098 分拆素数和

分拆素数和Problem Description把一个偶数拆成两个不同素数的和,有几种拆法呢? Input输入包含一些正的偶数,其值不会超过10000,个数不会超过500,若遇0,则结束。 Output对应每个偶数,输出其拆成不同素数的个数,每个结果占一行。 Sample Input30260

2018-04-03 18:49:14 317

原创 hdoj 2099 整除的尾数

整除的尾数Problem Description一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢? Input输入数据有若干组,每组数据包含二个整数a,b(0 Output对应每组数据,将满足条件的所有尾数在一行内输出,格式见样本输出。同组数据的输出,其每个尾数之间空一格,行末没

2018-04-03 18:11:29 197

原创 问题 1443: [蓝桥杯][历届试题]数字游戏

数字游戏题目描述栋栋正在和同学们玩一个数字游戏。 游戏的规则是这样的:栋栋和同学们一共n个人围坐在一圈。栋栋首先说出数字1。接下来,坐在栋栋左手边的同学要说下一个数字2。再下面的一个同学要从上一个同学说的数字往下数两个数说出来,也就是说4。下一个同学要往下数三个数,说7。依次类推。 为了使数字不至于太大,栋栋和同学们约定,当在心中数到 

2018-03-21 21:23:08 385

原创 hdoj 2036 改革春风吹满地

改革春风吹满地(链接)Input输入数据包含多个测试实例,每个测试实例占一行,每行的开始是一个整数n(3输入数据中所有的整数都在32位整数范围内,n=0表示数据的结束,不做处理。 Output对于每个测试实例,请输出对应的多边形面积,结果精确到小数点后一位小数。每个实例的输出占一行。 Sample Input

2017-12-09 21:43:28 258

原创 hdoj 4709 Herding

Herding(链接)Sample Input14-1.00 0.000.00 -3.002.00 0.002.00 2.00 Sample Output2.00 题意:求给出的n个点可以构成最小的三角形面积#include#include#include#includeusing namespa

2017-12-09 20:50:04 141

原创 hdoj 1014 Uniform Generator

Uniform Generator(链接)Sample Input3 515 2063923 99999 Sample Output 3 5 Good Choice 15 20 Bad Choice 63923 99999 Good Choi

2017-12-06 20:03:53 152

原创 hdoj 2570 迷瘴

迷瘴Problem Description通过悬崖的yifenfei,又面临着幽谷的考验——幽谷周围瘴气弥漫,静的可怕,隐约可见地上堆满了骷髅。由于此处长年不见天日,导致空气中布满了毒素,一旦吸入体内,便会全身溃烂而死。幸好yifenfei早有防备,提前备好了解药材料(各种浓度的万能药水)。现在只需按照配置成不同比例的浓度。现已知yifenfei随身携带有n种浓度的

2017-12-02 16:32:21 173

原创 hdoj 1570 A C

A C(链接)Problem DescriptionAre you excited when you see the title "AC" ? If the answer is YES , AC it ;You must learn these two combination formulas in the school . If you have forgotten

2017-12-02 16:23:32 200

原创 hdoj 1280 前m大的数

前m大的数(链接)Problem Description还记得Gardon给小希布置的那个作业么?(上次比赛的1005)其实小希已经找回了原来的那张数表,现在她想确认一下她的答案是否正确,但是整个的答案是很庞大的表,小希只想让你把答案中最大的M个数告诉她就可以了。 给定一个包含N(N Input输入可能包含多组数据,其中每组数据包括两行: 第

2017-12-02 16:18:24 138

原创 hdoj 1251 统计难题(字典树)

统计难题(链接)Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每个提问都是一个字符串.注意:本题只有一组测试数据,处理到文件结束. Output对于每个提问,给出以该字符串为前缀的单词的数量.

2017-11-21 22:47:34 164

原创 1305 Immediate Decodability(字典树)

Immediate Decodability(链接)Sample Input0110001000009011001000009 Sample OutputSet 1 is immediately decodableSet 2 is not immediately decodable//模板题#include#incl

2017-11-21 21:39:31 187

原创 hdoj 1004 Let the Balloon Rise(map)

Let the Balloon Rise(链接)Sample Input5greenredblueredred3pinkorangepink0 Sample Outputredpink 输出出现次数最多的颜色  用map存一下就好了#include#include#include#inclu

2017-11-19 21:10:05 217

原创 hdoj 1727 Hastiness

Hastiness(链接)模拟#include#includeusing namespace std;char one[20][10]={"zero","one","two","three","four","five","six","seven","eight","nine","ten"};char two[20][10]={"eleven","twelve","thirteen

2017-11-19 20:35:32 144

原创 hdoj 1719 Friend(公式)

Friend(链接)Problem DescriptionFriend number are defined recursively as follows.(1) numbers 1 and 2 are friend number;(2) if a and b are friend numbers, so is ab+a+b;(3) only the numbers

2017-11-19 20:24:22 142

原创 hdoj 1715 大菲波数

大菲波数(链接)Problem DescriptionFibonacci数列,定义如下:f(1)=f(2)=1f(n)=f(n-1)+f(n-2) n>=3。计算第n项Fibonacci数值。 Input输入第一行为一个整数N,接下来N行为整数Pi(1 Output输出为N行,每行为对应的f(Pi)。

2017-11-19 19:45:18 139

原创 hdoj 3763 CD(二分查找)

CD(链接)Sample Input3 31231240 0 Sample Output2二分查找 0.0.....int seach(int k){ int left=0,right=n2-1; int j; while(left<=right) { j=(left+r

2017-11-19 19:41:26 230

原创 hdoj 2639 Bone Collector II (01背包的第k优解)

Bone Collector II(链接)Sample Input35 10 21 2 3 4 55 4 3 2 15 10 121 2 3 4 55 4 3 2 15 10 161 2 3 4 55 4 3 2 1 Sample Output1220    求第k优解#includeusing names

2017-11-19 19:33:28 141

原创 hdoj 2844 Coins(多重背包)

Coins(链接)Sample Input3 101 2 4 2 1 12 51 4 2 10 0 Sample Output84把第i种物品换成Mi件01背包中的物品,则得到了物品数为ΣMi的01背包问题。我们可以通过二进制的拆分方法对其优化。对每i件物品,拆分的策略为:新拆分的物品的重量等于1件,2件

2017-11-19 18:58:43 233

原创 hdoj 2391 Filthy Rich(dp)不是搜素

Filthy Rich(链接)Sample Input13 41 10 8 80 0 1 80 27 0 4 Sample OutputScenario #1:42 注意要求:每组测试数据后输出一个空行#include#include#includeusing namespace std;const int max

2017-11-19 18:45:54 185

原创 hdoj 3449 Consumer(有依赖的背包)

Consumer题意: 给你一些物品,每个物品有自己的花费和价值,每个物品 都有相对应的箱子, 如果你想要买这个物品,你就需要先买这个箱子(依赖), 第一行先输入一个n 和t 代表 有几组物品 和你有多少钱(如果你要买该组物品,不管几个, 你都必须先买该组对应的箱子)求 n个箱子花费 t 能获得的最大价值Sample Input3 800300

2017-11-19 18:38:54 160

原创 hdoj 1002 A + B Problem II(大数加法)

1002 A + B Problem II可用作大数加法模板#includeusing namespace std;const int maxn = 1050;char a[maxn],b[maxn],c[maxn];void ADD(char *str1,char *str2,char *str3){ int i,j,i1,i2,tmp,carry; //c

2017-11-16 18:10:56 159

原创 hdoj 3535 AreYouBusy(混合背包)

AreYouBusyTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4572    Accepted Submission(s): 1862Problem DescriptionHappy New Term!

2017-11-13 19:50:48 273

原创 6033 Add More Zero

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6033 计算2m−1的位数可以看成m位的2进制换成10进制的位数#includeusing namespace std;int main(){ int m,i=0; while(scanf("%d",&m)!=EOF) { int

2017-08-26 19:16:46 204

原创 hdoj 1029 Ignatius and the Princess IV

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1029用map储存 maps;#include#include#include#includeusing namespace std;int main(){ int n; while(scanf("%d",&n)!=EOF) {

2017-08-08 15:35:14 176

原创 hdoj 1024 Max Sum Plus Plus(最大m子段和)=-=

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1024题意:给定由 n个整数(可能为负整数)组成的序列a1,a2,a3,……,an,以及一个正整数 m,要求确定序列的 m个不相交子段,使这m个子段的总和达到最大,求出最大和。ans=max{dp[m,j]}(mdp[i][j]=max{  dp[i,

2017-08-08 10:54:04 238

原创 hdoj 1003 Max Sum(动态规划)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1003题意:求最大连续子序列的和以及开始和结束的下标#include#include#include#includeusing namespace std;int main(){ int n,m,a; scanf("%d",&n); for(int j=1;j

2017-08-07 20:11:01 256

原创 hdoj 1015 Safecracker(窃贼) Dfs

题目真是啰嗦=-=(A=1, B=2, ..., Z=26)v - w^2 + x^3 - y^4 + z^5 = target 输入:tarrget+一段字符串输出:满足条件的字符串(多个按字典序)#include#include#include#include#define res(v,w,x,y,z) v-w*w+x*x*x-y*y

2017-08-07 18:25:31 3435

原创 poj 1321 棋盘问题(Dfs)

棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 49320 Accepted: 23874Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编

2017-08-07 16:32:57 183

原创 hdoj 1180 诡异的楼梯 bfs bfs bfs

诡异的楼梯(题目链接)#include#include#include#include#includeusing namespace std;char mat[25][25]; //地图int qq[20][20]; //标记int n,m,ans=9999;bool flag;int dir[4][2]={0,1,0,-1,1,0,-1,0};struct

2017-07-23 17:26:34 219

原创 hdoj 1072 Nightmare 广搜

Nightmare(链接)#include#include#include#includeusing namespace std;int t,n,m;int mat[10][10];int dir[4][2]={0,1,0,-1,1,0,-1,0};struct Node{ int x,y,ans,time;}s,t1,t2;void bfs() //广搜

2017-07-23 10:09:55 179

原创 hdoj 1010 Tempter of the Bone

Tempter of the BoneProblem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the groun

2017-07-22 20:28:43 211

原创 HDOJ 1017-A Mathematical Curiosity

A Mathematical CuriosityTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 41332 Accepted Submission(s): 13290Problem DescriptionGiven two inte

2017-07-22 20:11:30 240

原创 hdoj 1065 水水

报考杭州电子科技大学! I Think I Need a HouseboatTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13214    Accepted Submission(s): 3751

2017-06-20 20:21:06 309

解决报表中文无法显示问题.zip

将该文件解压后导入resource目录下 即可解决JasperReports生成报表时中文无法显示的问题

2020-01-04

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除