自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 UVA11987 带删除的并查集

第一次做这种并查集… 删除这个动作实在是不好想… 只要坐标超过最大给他个新内存就可以了 原来的地方给他留着用来存以前的集合最大值… 但是位置改到新坐标去 然后属性复制过去就可以了#include<iostream>#include<algorithm>#include<memory.h>#include<cstdio>using namespace std;int n, m;s

2016-09-30 17:15:05 397

原创 poj1330 裸LCA

Description A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with an integer from {1, 2,…,16}. Node 8 is

2016-09-30 14:17:52 346

原创 HDU1576 解方程....

Problem Description要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。 每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。Output对应每组数据输出(A/B)%9973。Sample Input2 1000

2016-09-30 13:37:31 322

原创 lightoj 1012 水广搜。。。最近我脑子不大好了

#include<iostream>#include<cstdio>#include<string>#include<algorithm>#include<queue>#include<string>using namespace std;string w[30];int xingzou[4][2]={{0,1},{1,0},{-1,0},{0,-1}};struct p{

2016-09-29 13:28:42 411

原创 lightoj 1020 水博弈

Alice and Bob are playing a game with marbles; you may have played this game in childhood. The game is playing by alternating turns. In each turn a player can take exactly one or two marbles.Both Alice

2016-09-29 10:52:52 298

原创 lightoj 1019 模板dijkstra

#include<iostream>#include<algorithm>#include<cstdio>#include<cmath>#include<memory.h>using namespace std;int dis[101];int tu[101][101];int yijing[101];int inf=0x3f3f3f3f;int main(){ int

2016-09-28 21:41:09 311

原创 lightoj 1016 水贪心

#include<iostream>#include<cstdio>#include<memory.h>#include<cstdio>#include<algorithm>#include<map>using namespace std;int tu[50001];int n, k;int main(){ int T; cin >> T; int u =

2016-09-28 21:19:39 297

原创 lightoj 1015 弱智

#include<iostream>#include<cstdio>#include<memory.h>#include<algorithm>#include<iomanip>#include<map>using namespace std;int main(){ int T; cin>>T; int u=0; while(T--) {

2016-09-28 18:00:48 178

原创 lightoj 1014 求一个数的所有因子

这个题一开始我求了k的所有质因子和其指数的值 用dfs求得所有因子但是超时了… 百度一下暴力… 好了记住以后这种破玩意就是暴力… mdzz#include<iostream>#include<cstdio>#include<memory.h>#include<algorithm>#include<iomanip>#include<map>using namespace std;

2016-09-28 17:54:49 548

原创 lightoj 1010 找规律坑比题

Given an m x n chessboard where you want to place chess knights. You have to find the number of maximum knights that can be placed in the chessboard such that no two knights attack each other.Those who

2016-09-28 14:57:42 511

原创 poj3122 二分

#include<iostream>#include<cstdio>#include<memory.h>#include<algorithm>#include<iomanip>using namespace std;double tu[10001];int main(){ int T; cin>>T; while(T--) { mems

2016-09-28 12:22:40 173

原创 poj1651 区间dp入门

Description The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the row and scores the number of points equ

2016-09-27 21:25:21 291

原创 HDU5902

问题描述 Alex发明了一个有趣的游戏. 一开始他在黑板上写了nn个正整数, 然后他开始重复进行如下的操作:他选择黑板上三个数字aa, bb和cc, 把他们从黑板上擦掉.他从这三个数aa, bb和cc中选择了两个数, 并计算出他们的最大公约数, 记这个数为dd (dd 可以是\gcd(a,b)gcd(a,b), \gcd(a,c)gcd(a,c)或者\gcd(b, c)gcd(b,c)).他

2016-09-26 21:37:40 424

原创 poj2955 水区间DP

Description We give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence, if s is a regular brackets sequence, then (s) and [s] are re

2016-09-26 12:39:07 225

原创 HDU5904 思路不错的dp....比我的蠢逼LCS强多了

Problem DescriptionAlex has two sequences a1,a2,…,an and b1,b2,…,bm. He wants find a longest common subsequence that consists of consecutive values in increasing order.InputThere are multiple test case

2016-09-25 00:40:13 344

原创 lightoj 1008 找找规律...水

Fibsieve had a fantabulous (yes, it’s an actual word) birthday party this year. He had so many gifts that he was actually thinking of not having a party next year.Among these gifts there was an N x N g

2016-09-23 16:01:45 311

原创 lightoj 1007 欧拉函数

Mathematically some problems look hard. But with the help of the computer, some problems can be easily solvable.In this problem, you will be given two integers a and b. You have to find the summation o

2016-09-23 15:19:43 252

原创 lightoj 1003 拓扑裸题

One of my friends is always drunk. So, sometimes I get a bit confused whether he is drunk or not. So, one day I was talking to him, about his drinks! He began to describe his way of drinking. So, let m

2016-09-23 13:04:30 410

原创 lightoj 1002 变形dijkstra

I am going to my home. There are many cities and many bi-directional roads between them. The cities are numbered from 0 to n-1 and each road has a cost. There are m roads. You are given the number of m

2016-09-22 17:20:08 321

原创 lightoj 1006 水水....

#include<iostream>#include<queue>#include<stack>#include<cstdio>#include<memory.h>#include<algorithm>#include<vector>using namespace std;long long f[10001],n,u=0,T;long long inf=10000007;int

2016-09-21 17:07:13 278

原创 lightoj 1018 一个比较重要的状态转移的剪枝技巧....DFS+状压dp

Mubashwir returned home from the contest and got angry after seeing his room dusty. Who likes to see a dusty room after a brain storming programming contest? After checking a bit he found an old toothb

2016-09-21 16:28:12 322

原创 HDU5492 十分数学的DP

Problem Description Frog fell into a maze. This maze is a rectangle containing N rows and M columns. Each grid in this maze contains a number, which is called the magic value. Frog now stays at grid (

2016-09-17 02:09:21 276

原创 light oj 1017 简单区间dp...新学会的东西

Samir returned home from the contest and got angry after seeing his room dusty. Who likes to see a dusty room after a brain storming programming contest? After checking a bit he found a brush in his ro

2016-09-16 01:59:33 228

原创 HDU2196 终于不是水题的树形dp啦哈哈哈哈哈哈

Description A school bought the first computer some time ago(so this computer’s id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one of settled

2016-09-12 17:09:23 238

原创 HDU1561 这应该也是一个很裸的树上背包...

Problem Description ACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的宝物应该攻克哪M个城堡吗?Input 每个测试实例首先包括2个整数,N,M.(1 <= M <=

2016-09-09 17:39:22 423

原创 HDU1290 水题

写下来的原因是因为一个以后不用算的东西… 切立体的东西最多的块数就是n^3+5n+6#include<memory.h>#include<iostream>#include<algorithm>#include<cmath>#include<string>using namespace std;int main(){ int n; while(cin>>n)

2016-09-08 20:40:47 323

原创 light oj 1013 迷之ac...我不知道为什么不re

Yes, you are developing a ‘Love calculator’. The software would be quite complex such that nobody could crack the exact behavior of the software.So, given two names your software will generate the perc

2016-09-08 20:07:21 315

原创 POJ2486 树上背包裸题

DescriptionWshxzt is a lovely girl. She likes apple very much. One day HX takes her to an apple tree. There are N nodes in the tree. Each node has an amount of apples. Wshxzt starts her happy trip at o

2016-09-07 19:57:24 397

原创 light oj 1011 一个普通记录...(路径?)的状压dp

You work in a company which organizes marriages. Marriages are not that easy to be made, so, the job is quite hard for you.The job gets more difficult when people come here and give their bio-data with

2016-09-06 21:41:58 328

原创 light oj 1005 不知道是个什么玩意

A rook is a piece used in the game of chess which is played on a board of square grids. A rook can only move vertically or horizontally from its current position and two rooks attack each other if one

2016-09-06 20:19:01 478

原创 light oj 1004 水DP

#include<iostream>#include<cstdio>#include<algorithm>#include<memory.h>using namespace std;int dp[300][300];int cun[300];int n;int main(){ int T; cin>>T; int u=0; while(T--)

2016-09-06 15:28:22 243

原创 lightoj 1200 水完全背包

把他需要的重量减掉来一个完全背包#include<iostream>#include<cstdio>#include<algorithm>#include<memory.h>using namespace std;int p[101];int w[101];int yao[101];int dp[10001];int n,k;int u=0;int main(){ i

2016-09-06 14:07:10 274

原创 lightoj 1201 裸树形dp

“Yes, I am the murderer. No doubt” I had to confess it in front of all. But wait, why I am confessing? Nobody wants to go to jail, neither do I. As you have suspected there is something fishy. So, let

2016-09-05 15:15:22 233

原创 HDU1695 略微有坑的容斥

Description Given 5 integers: a, b, c, d, k, you’re to find x in a…b, y in c…d that GCD(x, y) = k. GCD(x, y) means the greatest common divisor of x and y. Since the number of choices may be very large

2016-09-02 15:02:24 314

原创 HDU1520 树形DP裸题

Problem Description 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

2016-09-02 13:17:16 276

空空如也

空空如也

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

TA关注的人

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