- 博客(50)
- 收藏
- 关注
原创 Odd Palindrome Gym - 101615A
题目:https://vjudge.net/problem/Gym-101615A只需要判断长度为偶数时,有没有回文串。#include <iostream>#include <stdio.h>#include <string.h>using namespace std;const int maxn = 105;int main()...
2018-08-30 00:14:44 190
Delayed Work Gym - 101615L (数学)
题目:https://vjudge.net/problem/Gym-101615L求出 y = (k * q)/ m + m * x的最小值,其实可以按照基本不等式来解决,求出 m = sqrt(k * q / x );之后列举他两边的值:求出最小的值。#include <iostream>#include <stdio.h>#include <...
2018-08-30 00:12:27 191
原创 HDU-3974(dfs序获得时间戳建立线段树)
题目:There is a company that has N employees(numbered from 1 to N),every employee in the company has a immediate boss (except for the leader of whole company).If you are the immediate boss of someone,...
2018-08-25 00:47:47 262
原创 HDU-1540(线段树区间合并)
题目:During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected by tunnels lay in a line. Exc...
2018-08-24 01:05:37 175
原创 UVALive-8074(深搜)
题目:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=6096深搜的题,以往就对深搜不敏感,排位赛上没做出来,好奇哦!#include <iostream>#include <stdio....
2018-08-23 19:43:06 94
原创 HDU 4027(线段树)
题目:A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be marked a value o...
2018-08-23 11:50:43 270
原创 poj3264(线段树区间最大值最小值)
题目:For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To keep th...
2018-08-22 23:10:10 226
原创 hdu-1698(线段树区间修改)
题目:In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length. No...
2018-08-21 21:36:29 601 1
原创 poj 2528贴海报(线段树+离散化)
题目:The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has fina...
2018-08-21 17:00:40 257
转载 多米诺骨牌问题,状态压缩dp
转:链接:https://blog.csdn.net/shiwei408/article/details/8821853https://blog.csdn.net/u013480600/article/details/19499899题目描述:用1*2 的矩形通过组合拼成大矩形,求拼成指定的大矩形有几种拼法。首先 我们先求用1*2 的矩形拼成 n*m的矩形有多少种拼法当n*m为...
2018-08-20 00:28:28 434
原创 状态压缩dppoj1185
题目:司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示: 如果在地图中的灰色所标识的平原上部署一支炮兵部队,则图中的黑色的网格表示它能够攻击到的...
2018-08-19 19:38:49 107
原创 状态压缩入门(Poj3254)
题目:Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettab...
2018-08-19 13:47:18 150
原创 ****poj2378(树形dp)
题目:After Farmer John realized that Bessie had installed a "tree-shaped" network among his N (1 <= N <= 10,000) barns at an incredible cost, he sued Bessie to mitigate his losses. Bessie, feel...
2018-08-16 21:12:47 109
原创 poj 1463(树形dp)
题目:Bob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He must defend a me...
2018-08-16 16:31:58 174
原创 Information Disturbing (树形dp)hdu3586
题目:In the battlefield , an effective way to defeat enemies is to break their communication system. The information department told you that there are n enemy soldiers and their network which have n...
2018-08-16 14:34:04 121
原创 hdu--2059(龟兔赛跑)区间dp
题目:据说在很久很久以前,可怜的兔子经历了人生中最大的打击——赛跑输给乌龟后,心中郁闷,发誓要报仇雪恨,于是躲进了杭州下沙某农业园卧薪尝胆潜心修炼,终于练成了绝技,能够毫不休息得以恒定的速度(VR m/s)一直跑。兔子一直想找机会好好得教训一下乌龟,以雪前耻。 最近正值HDU举办50周年校庆,社会各大名流齐聚下沙,兔子也趁此机会向乌龟发起挑战。虽然乌龟深知获胜希望不大,不过迫于舆论压力,只能...
2018-08-16 00:41:29 109
原创 ***** 树形dp(1)poj--2342
题目:There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervisor relation forms...
2018-08-15 23:13:46 66
原创 The Unique MST poj 1679(次小生成树)
题目:POJ - 1679 Given a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G ...
2018-08-15 21:06:39 136
原创 Treats for the Cows(poj--3186)区间dp
题目:FJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day and wants to maximize the money he receives over a gi...
2018-08-15 00:44:54 110
原创 Help Jimmy poj--1661(dp)
题目:http://poj.org/problem?id=1661"Help Jimmy" 是在下图所示的场景上完成的游戏。 场景中包括多个长度和高度各不相同的平台。地面是最低的平台,高度为零,长度无限。 Jimmy老鼠在时刻0从高于所有平台的某处开始下落,它的下落速度始终为1米/秒。当Jimmy落到某个平台上时,游戏者选择让它向左还是向右跑,它跑动的速度也是1米/秒。当Jimmy...
2018-08-14 21:53:45 102
原创 Common Subsequence poj--1458(最长公共子序列)
题目:http://poj.org/problem?id=1458A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, ..., xm > another sequence ...
2018-08-14 00:19:34 104
原创 Max sum plus plus---HDU--1024(动态规划)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1024Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now ...
2018-08-13 23:18:18 141
原创 Fliptile(反转问题状态压缩)poj 3279.
题目:Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate an M× N grid (1 ≤ M ≤ 15; 1 ≤ N ...
2018-08-12 21:04:07 198
原创 Dropping tests(poj 2976)01分数规划
题目;http://poj.org/problem?id=2976In a certain course, you take n tests. If you get ai out of bi questions correct on test i, your cumulative average is defined to be.Given your test scores and a...
2018-08-12 15:02:29 102
原创 Gym - 100187H(相似三角形判断)
题目:StatementsEveryone probably heard the rumours about the constellation of Bermuda Triangle: any person who looks to this constellation of three stars is said to disappear completely. Though, it'...
2018-08-11 22:49:01 204
原创 Gym - 100187L
题目:StatementsAndrey works in the Ministry of Truth. His work is changing articles in newspapers and magazines so that they praise the Party and Big Brother.Recently Big Brother decided that it w...
2018-08-11 22:44:50 231
原创 Gym - 100187B(期望)
题目:StatementsTwo boys Gena and Petya wrote on two strips of paper the same string s that consisted of lowercase Latin letters. Then each boy took one strip, cut it into small pieces so that each p...
2018-08-11 22:29:31 157
原创 tree_recovery(递归)poj2255
题目:http://poj.org/problem?id=2255题目:Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in the nodes. ...
2018-08-10 20:35:53 149
原创 Pie(poj -3122)(二分答案)
题目:http://poj.org/problem?id=3122 My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my frien...
2018-08-10 16:05:27 2202 1
原创 Median(poj-3579)-二分答案
题目:http://poj.org/problem?id=3579Given N numbers, X1, X2, ... , XN, let us calculate the difference of every pair of numbers: ∣Xi - Xj∣ (1 ≤ i < j ≤ N). We can get C(N,2) differences through this wo...
2018-08-10 14:25:48 216
原创 POJ-3258-River Hopscotch (二分答案)
题目:http://poj.org/problem?id=3258Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place ...
2018-08-09 21:34:15 196
原创 最少拦截系统(最长不下降子序列)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1257某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹. 怎么办呢?多搞几套系统呗!...
2018-08-07 21:02:08 165
原创 Tickets(线性DP)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1260Jesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He ...
2018-08-07 15:53:37 152
原创 Piggy-Bank(完全背包)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1114Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreve...
2018-08-06 22:14:11 155
原创 Super Jumping! Jumping! Jumping! (最长上升子序列)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1087Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this...
2018-08-06 16:41:18 169
原创 HDU--3579Hello Kiki(中国剩余定理非互质情况)
题目:https://vjudge.net/contest/242290#problem/DOne day I was shopping in the supermarket. There was a cashier counting coins seriously when a little kid running and singing "门前大桥下游过一群鸭,快来快来 数一数,二四六七八...
2018-08-05 21:10:35 246
原创 Chinese remainder theorem again(最小公倍数)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1788我知道部分同学最近在看中国剩余定理,就这个定理本身,还是比较简单的: 假设m1,m2,…,mk两两互素,则下面同余方程组: x≡a1(mod m1) x≡a2(mod m2) … x≡ak(mod mk) 在0<=<m1m2…mk内有唯一解。 记Mi=M/mi(1<...
2018-08-05 16:32:40 118
原创 Biorhythms (中国剩余定理)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1370BiorhythmsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5184 Accepted Submission(s): ...
2018-08-05 15:50:06 201
原创 字典树
Trie树----需要Trie树----需要的数据结构的数据结构,num是他的身份。如果是字符串也可以。const int INDEX_N = 26; //一个字符串中最多有多少种字符struct Node { //树的节点 int num; //num表示是几号门 Node *next[INDEX_N]; //next数组指向子节点 Node(): nu...
2018-08-03 00:17:07 99
原创 Keywords Search (AC自动机)
题目:https://vjudge.net/contest/243048#problem/IIn the modern time, Search engine came into the life of everybody like Google, Baidu, etc. Wiskey also wants to bring this feature to his image retriev...
2018-08-02 22:12:04 1061
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人