自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

qwesde

勿忘初心

  • 博客(28)
  • 收藏
  • 关注

原创 ZOJ 1136 Multiple(BFS + 数论 同余剪枝 搜索数字的倍数 )

ZOJ Problem Set - 1136 Multiple Time Limit: 10 Seconds Memory Limit: 32768 KBa program that, given a natural number N between 0 and 4999 (inclusively), and M distinct decimal digits X1,X2..XM (a

2015-07-31 15:10:28 1316

原创 HDU 1885Key Task(bfs + 状态压缩)

Key Task Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1529 Accepted Submission(s): 631Problem Description The Czech Technical Universit

2015-07-31 12:05:25 579

原创 HDU 1429胜利大逃亡(续) (bfs+状态压缩)

胜利大逃亡(续)Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6469 Accepted Submission(s): 2243Problem DescriptionIgnatius再次被魔王抓走了(搞不懂他咋这么讨魔王

2015-07-31 10:39:23 558

原创 UVa 10651 Pebble Solitaire(状态压缩DP)

题意:转化为01序列,可以做如下转换011-->100, 110-->001使得序列的1最少二进制的集合表示:空集:0全集:( 1集合里添加元素:S|(1集合删去元素:S&~(1#include#include#include#include#include#include#include#include#include#include#incl

2015-07-29 18:13:15 514

原创 uva10051(dp 立方体塔, 拆分)

题意:有n个立方体,每一面都有颜色,现在要用他们堆出高度尽量高的塔,条件是,两个接触的块,他们的接触面颜色要一样,同时上面的块重量要严格小于他下面的。 与LIS思想一样,题目给出的数据是按重量递增的#include<iostream>#include<algorithm>#include<map>#include<cstdio>#include<cstdlib>#include<vec

2015-07-29 14:58:08 495

原创 uva10534(DP之LIS的应用 )

题意:在给出的序列中找到一个长度为奇数的序列,且序列前半段严格单调递增,后半段严格单调递减。 解答:进行两次LIS,一次正向,一次逆向,LIS选用Nlogn的算法/*Solve:*/#include<iostream>#include<algorithm>#include<map>#include<cstdio>#include<cstdlib>#include<vector>#i

2015-07-27 21:50:24 382

原创 uva10069(DP+大数)

题意:找出B串在A串出现的次数(B在A中可以是不连续的) 解答:设母串的长度是j,子串的长度数i,在假设dp[i][j]:是在长度是j的母串中出现长度是i的子串的个数,如果A[j]!=B[i],dp[i][j]=dp[i][j-1] 如果A[j]==B[i]; dp[i][j]=dp[i-][j-1]+dp[i][j-1];大数直接用JAVA好了import java.math.BigInte

2015-07-27 19:32:37 575

原创 uva10404 Bachet’s Game(dp之取石子游戏的胜负)

Bachet’s game is probably known to all but probably not by this name. Initially there are n stones on the table. There are two players Stan and Ollie, who move alternately. Stan always starts. The

2015-07-25 15:32:42 616

原创 uva10285 Longest Run on a Snowboard(dp之记忆化搜索 )

10285 Longest Run on a Snowboard Michael likes snowboarding. That’s not very surprising, since snowboarding is really great. The bad thing is that in order to gain speed, the area must slide downward

2015-07-25 12:54:55 777

原创 uva531Compromise (最长公共子序列+路径输出)

Compromise Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVA 531 Appoint description:Description Download as PDFIn a few months the European Currency

2015-07-24 17:14:59 642

原创 uva624 CD (01背包+路径的输出)

CD Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVA 624 Appoint description:Description Download as PDFYou have a long drive by car ahead. You have

2015-07-24 13:47:32 706

原创 uva348Optimal Array Multiplication Sequence (最优矩阵链乘+路径输出)

Optimal Array Multiplication Sequence Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVA 348 Appoint description:Description Download as PDFGiven two

2015-07-24 13:44:20 1113

原创 uva10131 Is Bigger Smarter?(经典DP,最长上升子序列,注意保存路径部分)

Is Bigger Smarter? The ProblemSome people think that the bigger an elephant is, the smarter it is. To disprove this, you want to take the data on a collection of elephants and put as large a subset of

2015-07-22 16:14:40 817

原创 uva 116 Unidirectional TSP 单向TSP 问题,经典dP(路径输出注意规划方向)

Unidirectional TSP Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVA 116 Appoint description:Description Download as PDFBackgroundProblems that requi

2015-07-22 15:04:23 883

原创 POJ 3264 RMQ--ST 算法

Balanced Lineup Time Limit: 5000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionFor the daily milking, Farmer John’s N cows (1 ≤ N ≤ 50,000) always line up in

2015-07-22 09:48:03 566

原创 uva10003 Cutting Sticks 经典dP,表达式上的动态规划

You have to cut a wood stick into pieces. The most affordable company, The Analog Cutting Machinery, Inc. (ACM), charges money according to the length of the stick being cut. Their procedure of work re

2015-07-22 09:10:14 963

原创 uva 674 Coin Change 经典dp入门

Coin Change Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVA 674 Appoint description:Description Download as PDFSuppose there are 5 types of coins:

2015-07-21 10:43:37 677

原创 uva 10719 Quotient Polynomial

10719 Quotient Polynomial A polynomial of degree n can be expressed as p(x) = anxn + an−1xn−1 +···+ a1x + a0 If k is any integer then we can write: p(x) = (x−k)q(x) + r Here q(x) is called the quotie

2015-07-06 12:16:02 594

原创 uva11044 Searching for Nessy

Searching for Nessy Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVA 11044 Appoint description:Description Download as PDFThe Loch Ness Monsteris a

2015-07-06 12:14:44 617

原创 uva 10790 How Many Points of Intersection?

10790 How Many Points of Intersection? We have two rows. There are a dots on the top row and b dots on the bottom row. We draw line segments connecting every dot on the top row with every dot on the b

2015-07-06 12:12:36 490

原创 uva 10499 The Land of Justice

In the Land of Justice the selling price of everything is fixed all over the country. Nobody can buy a thing and sell it in double price. But, that created problems for the businessmen. They left their

2015-07-06 12:10:35 545

原创 uva846 Steps

Steps Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVA 846 Appoint description:Description Download as PDFOne steps through integer points of the st

2015-07-06 12:09:02 686

原创 uva573 The Snail

The Snail Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVA 573 Appoint description:Description Download as PDFA snail is at the bottom of a 6-foot w

2015-07-06 12:07:29 521

原创 uva107 The Cat in the Hat

The Cat in the Hat Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVA 107 Appoint description:Description Download as PDFBackground(An homage to Theod

2015-07-06 12:02:16 891

原创 uva 591 Box of Bricks

Little Bob likes playing with his box of bricks. He puts the bricks one upon another and builds stacks of different height. Look, I've built a wall!'', he tells his older sister Alice.Nah, you should m

2015-07-06 11:59:14 757

原创 uva10025 The ? 1 ? 2 ? ... ? n = k problem

10025 The ? 1 ? 2 ? … ? n = k problem Given the following formula, one can set operators ‘+’ or ‘-’ instead of each ‘?’, in order to obtain a given k ?1?2?…?n = k For example: to obtain k = 12, the e

2015-07-06 11:57:21 526

原创 UVA 621 Secret Research

Secret Research Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVA 621 Appoint description:Description Download as PDFAt a certain laboratory results

2015-07-06 11:51:17 495

原创 UVA 253 Cube painting

UVA 253 Cube paintingTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVA 253 Appoint description:Description Download as PDFWe have a machine for painti

2015-07-06 11:45:50 605

空空如也

空空如也

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

TA关注的人

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