自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(106)
  • 收藏
  • 关注

转载 hdu2844Coins(多重背包模板)

CoinsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 20860Accepted Submission(s): 8198Problem DescriptionWhuacmers use coins.They...

2018-12-21 22:07:00 182

转载 PageHelper分页插件使用

mybatis的分页插件jar包:配置方法:在mybatis配置文件中加下面代码 1 <plugin interceptor="com.github.pagehelper.PageInterceptor"> 2 <!-- 设置数据库类型 Oracle,Mysql,MariaDB,SQLite,Hsqldb,PostgreS...

2018-12-21 19:17:00 359

转载 hdu1829A Bug's Life(种类并查集)

传送门关键在于到根节点的距离,如果两个点到根节点的距离相等,那么他们性别肯定就一样(因为前面如果没有特殊情况,两个点就是一男一女的)。一旦遇到性别一样的,就说明找到了可疑的 1 #include<bits/stdc++.h> 2 using namespace std; 3 int f[2005],n,m,rankk[2005]; 4 bool f...

2018-11-21 22:06:00 176

转载 hdu1272小希的迷宫(并查集判断回路和是否连通)

传送门迷宫中不能有回路,还要连通如果最后集合数是一个那就是连通,否则不联通要合并的两个顶点在相同集合内,表示出现了回路输入时注意一下 1 #include<bits/stdc++.h> 2 using namespace std; 3 int f[100005]; 4 int getf(int v) 5 { 6 if(f...

2018-11-20 20:58:00 217

转载 hdu1232畅通工程(并查集,简单题)

传送门最少好要修多少条路太能使全部城镇连通。只要用并查集算可以连通的城市的组数,修的路就是组数减1 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define C getchar() 4 template <typename T> 5 inline void read(T &...

2018-11-20 19:10:00 95

转载 hdu1285确定比赛名次(拓扑排序+优先队列)

传送门第一道拓扑排序题每次删除入度为0的点,并输出这题要求队名小的排前面,所以要用到重载的优先队列 1 #include<bits/stdc++.h> 2 using namespace std; 3 priority_queue<int,vector<int>,greater<int> > q;//优先队列...

2018-11-20 16:09:00 160

转载 hdu1546Idiomatic Phrases Game(floyd+map)

传送门成语接龙,找每个单词都需要一点时间,问最少的时间把字符串用map处理成数字编号,之后用floyd 1 #include<bits/stdc++.h> 2 using namespace std; 3 map<string,int>g; 4 int road[1005][1005]; 5 int num=0; 6 con...

2018-11-20 14:02:00 91

转载 hdu2544最短路(dijkstra)

传送门dijkstra 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int INF=0x3f3f3f3f; 4 const int maxn=1200; 5 6 int dist[maxn],g[maxn][maxn],N; 7 bool vis[maxn]; ...

2018-11-19 18:41:00 69

转载 hdu2795 Billboard(线段树单点修改)

传送门结点中的l和r表示层数,maxx表示这层最多还剩下多少宽度。根据公告的宽度取找到可以放的那一层找到后返回层数,并修改maxx 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn= 200000+5; 4 int h,w; 5 int ans; 6 s...

2018-11-19 14:42:00 88

转载 hdu1754 I Hate It(线段树单点更新,区间查询)

传送门有更新单个学生成绩和查询某个区间内学生成绩最大值两种操作线段树代码 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=200000+5; 4 using namespace std; 5 int a[maxn*4]; 6 const int INF=...

2018-11-19 00:05:00 92

转载 hdu2187悼念512汶川大地震遇难同胞——老人是真饿了(贪心 简单题)

传送门简单题 1 #include<bits/stdc++.h> 2 using namespace std; 3 struct node 4 { 5 double dan,weight; 6 }a[1005]; 7 bool cmp(node x,node y) 8 { 9 return x.dan<y....

2018-11-18 20:55:00 126

转载 牛客小白月赛9 A签到(分数取模,逆元)

传送门对分母求一下逆元,把除法取模变成乘法取模,逆元介绍看这里这种方法只适合模为质数的情况 1 #include<bits/stdc++.h> 2 using namespace std; 3 const long long mod=1e9+7; 4 long long quickpow(long long a, long long b) {...

2018-11-18 15:41:00 174

转载 牛客小白月赛9H论如何出一道水题(两个连续自然数互质)

题面记录一下。。。连续得两个自然数互质,这题再特判一下1的情况 1 #include<bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 long long n; 6 while(~scanf("%lld",&n)) 7 { 8 ...

2018-11-17 23:05:00 128

转载 EOJ3134. 短信激活码(大数幂取模)

题面输入只有5位,所以转化为long long类型用快速幂取模前面补0的写法printf("%05lld\n",ans);如果ans不足5位会在前面补0 1 #include<bits/stdc++.h> 2 using namespace std; 3 long long mod_exp(long long a, long long b, lon...

2018-11-17 17:06:00 165

转载 EOJ3650 转机折扣(26进制,字符串)

题面看成26进制,把较小的那个字符串加1strcmp(s1,s2)s1和s2有大小时,不一定都是返回1或者-1.。。。。这个地方wa了好几次没有发现 1 #include<bits/stdc++.h> 2 using namespace std; 3 char s1[100010],s2[100010]; 4 void print(char s...

2018-11-17 15:42:00 142

转载 hdu1042 N!(大数求阶乘)

N!Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 94583Accepted Submission(s): 28107Problem DescriptionGiven an integer N(0 ≤ ...

2018-11-17 11:31:00 96

转载 hdu2061 Treasure the new start, freshmen!(暴力简单题)

Treasure the new start, freshmen!Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23047Accepted Submission(s): 6814Problem Descripti...

2018-11-16 16:32:00 369

转载 hdu2065"红色病毒"问题(指数母函数+快速幂取模)

"红色病毒"问题Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9329Accepted Submission(s): 3816Problem Description医学界发现的新病毒因其蔓延速度和Intern...

2018-11-16 00:54:00 114

转载 uvaoj 156Ananagrams(map和vector组合使用)

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=92输入一些单词,找出所有符合条件的单词:该单词不能通过字母重排,得到输入文本中的另外一个单词。判断条件是否满足时,字母不分大小写,但在输出时应保留输入中的大小写。并...

2018-11-15 21:06:00 149

转载 使用idea写ssm的时候提示源文件夹中的文件找不到

<context:property-placeholder location="classpath:db.properties"/>这一行idea提示找不到db.properties这个文件原因是idea和myeclipse有点不一样,需要将包含这个文件夹的文件设置为源文件夹将这个文件夹设置为Resource Root,因为我已经设置过了,所以只有Un...

2018-11-15 20:23:00 190

转载 uvaoj 1081510815 - Andy's First Dictionary(set应用)

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=835&page=show_problem&problem=1756输入一个文本,找出所有不同的单词,按字典序从小到大输出,单词不区分大小写。使用string和set,输入时把所有非字母的字符...

2018-11-15 17:54:00 101

转载 hdu5305 Friends(dfs,多校题)

FriendsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2945Accepted Submission(s): 1413Problem DescriptionThere arenpeople and...

2018-11-14 23:58:00 75

转载 hdu1106 排序(字符串分割,strtok+sscanf)

排序Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 75271Accepted Submission(s): 23079Problem Description输入一行数字,如果我们把这行数字中的‘5’都看成空格...

2018-11-14 17:38:00 122

转载 hdu1051 Wooden Sticks(贪心+排序,逻辑)

Wooden SticksTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 26095Accepted Submission(s): 10554Problem DescriptionThere is a pile...

2018-11-14 14:44:00 102

转载 找钱(贪心,比较简单)

找钱Time Limit : 3000/1000ms (Java/Other)Memory Limit : 65535/32768K (Java/Other)Total Submission(s) : 55Accepted Submission(s) : 24Font:Times New Roman|Verdana|GeorgiaFont Size:...

2018-11-14 13:19:00 172

转载 hdu1789 Doing Homework again(贪心+排序)

Doing Homework againTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18294Accepted Submission(s): 10648Problem DescriptionIgnatius...

2018-11-14 13:13:00 188

转载 uvaoj 101 - The Blocks Problem(vector应用+技巧)

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=835&page=show_problem&problem=37木块问题,模拟堆的操作。每个堆的高度不确定,用vector来做很合适(vector动态)。本题模拟四个操作:1.move a...

2018-11-14 12:05:00 106

转载 uvaoj 10474 - Where is the Marble?(sort+lower_bound)

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1415STL中sort和lower_bound(返回大于或者等于x的第一个位置)应用 1 #include<bits/stdc++.h> 2 u...

2018-11-13 16:31:00 124

转载 uvaoj 213 - Message Decoding(二进制,输入技巧)

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=149跨行读字符的函数readchar() 可以学习一下把编码理解成二进制,用(len,value)这个二元组来表示一个编码,其中len是编码长度,value是编码...

2018-11-13 14:59:00 139

转载 uvaoj 133 - The Dole Queue(逻辑,环形队列数数)

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=69有n个人向内排成一圈,从一个位置开始逆时针数k个,第k个出队,从一个位置开始顺时针数m个,第m个出队,并输出出队的顺序。这题主要是环形队列数数函数的编写。...

2018-11-13 13:29:00 142

转载 uvaoj 489 - Hangman Judge(逻辑+写代码能力)

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=430猜单词游戏。计算机给出一个字符串让你猜,每次猜一个字母。如果字符串中有那个字母,所有该字母都会显示出来。猜错7次就输了,全猜完算赢。到最后也没猜完,算放弃。这题...

2018-11-12 17:17:00 153

转载 uvaoj1339 - Ancient Cipher(思维题,排序,字符串加密)

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4085两个字符串,判断能否把其中一个字符串重排,然后对每个字母进行映射(比如映射到前一个字母),使得两个字符串相同这里要转一个弯,既然字母可以重排,那么每个字母最初...

2018-11-12 00:56:00 173

转载 hdu1969Pie(根据体积二分,分馅饼)

PieTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17056Accepted Submission(s): 5995Problem DescriptionMy birthday is coming up a...

2018-11-11 22:14:00 381

转载 hdu2899Strange fuction(解方程+二分)

Strange fuctionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10462Accepted Submission(s): 6996Problem DescriptionNow, here is a...

2018-11-11 19:09:00 131

转载 hdu2199Can you solve this equation?(解方程+二分)

Can you solve this equation?Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 25633Accepted Submission(s): 11018Problem Description...

2018-11-11 15:44:00 189

转载 cf#516C. Oh Those Palindromes(最多回文子串的字符串排列方式,字典序)

http://codeforces.com/contest/1064/problem/C题意:给出一个字符串,要求重新排列这个字符串,是他的回文子串数量最多并输出这个字符串。题解:字典序排列的字符串回文子串最多。 1 #include<bits/stdc++.h> 2 using namespace std; 3 char s[100005]; 4...

2018-11-10 20:58:00 327

转载 cf#516B. Equations of Mathematical Magic(二进制,位运算)

https://blog.csdn.net/zfq17796515982/article/details/83051495题意:解方程:a-(a^x)-x=0 给出a的值,要求计算解(非负)的个数题解:需要^和 - 起到相同的效果。1^1=0 1-1=01^0=1 1-0=10^0=0 0-0=0,0^1=1 0-1=-1a的二进制位上为1时,x的二进制位上为...

2018-11-10 20:56:00 82

转载 cf#516A. Make a triangle!(三角形)

http://codeforces.com/contest/1064/problem/A题意:给出三角形的三条边,问要让他组成三角形需要增加多少长度题解:规律:如果给出的三条边不能组成三角形,那答案就是最大边减去另外两条边+1 1 #include<bits/stdc++.h> 2 using namespace std; 3 int main()...

2018-11-10 20:49:00 156

转载 hdu1312Red and Black(迷宫dfs,一遍)

Red and BlackTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 26802Accepted Submission(s): 16176Problem DescriptionThere is a rect...

2018-11-09 16:24:00 52

转载 hdu1010Tempter of the Bone(迷宫dfs+剪枝)

Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 151147Accepted Submission(s): 40285Problem DescriptionThe dogg...

2018-11-09 15:25:00 71

空空如也

空空如也

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

TA关注的人

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