自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

so_so_y的博客

红鲤鱼绿鲤鱼与驴律与率

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

原创 HDU 2089 不要62 & HDU 3652 B-number(初级数位DP)

HDU 2089 不要62解题思路dp[len][mark]中 len 代表当前处理的数位,mark 标记上一位的数字是否为6。代码实现#include<iostream>#include<cstdio>#include<cstring>using namespace std;#define maxn 10int dp[maxn][2],num[maxn];int dfs(int len

2017-08-28 20:04:10 268

原创 POJ 2955 Brackets & POJ 1505 Copying Books & POJ 1651 Multiplication Puzzle(初级区间DP)

POJ 2955 Brackets题目大意在给定字符串中有多少个可匹配括号,()和[]为可匹配。解题思路dp[i][j]代表i~j有多少个可匹配的字符串。 转移方程: 1、dp[i][j]=dp[i+1][j-1]+2,当i,j位置组成可匹配括号; 2、枚举分割点k (i<=k<j)(i<=k<j) :dp[i][j]=max(dp[i][j],dp[i][k]+dp[k+1][j])代码实

2017-08-26 21:35:52 232

原创 HDU 3695 Computer Virus on Planet Pandora and HDU 2896 病毒侵袭(AC自动机裸题)

题目大意都是给出几个病毒模式串,然后再给一个串看其中有多少个病毒,不同的是3695要求将串反转一次,2896是对于每个网站按照标号顺序输出含有的病毒串和含有病毒的网站总数。解题思路都是按照给的病毒模式串建立AC自动机,3695将串正向和反向均匹配一次,2896是将记录每个匹配到的字符串然后按照标号顺序输出,注意要对已经匹配到的病毒串进行标记,避免重复计数。 另外我的代码G++MLE,C++AC。初

2017-08-24 21:44:47 251

原创 HDU 6158 The Designer(笛卡尔定理+韦达定理)

Problem DescriptionNowadays, little haha got a problem from his teacher.His teacher wants to design a big logo for the campus with some circles tangent with each other. And now, here comes the problem.

2017-08-21 21:29:59 2549

原创 HDU 6153 A Secret(扩展KMP)

Problem DescriptionToday is the birthday of SF,so VS gives two strings S1,S2 to SF as a present,which have a big secret.SF is interested in this secret and ask VS how to get it.There are the things tha

2017-08-21 18:17:57 563

原创 HDU 6154 CaoHaha's staff

Problem Description“You shall not pass!” After shouted out that,the Force Staff appered in CaoHaha’s hand. As we all know,the Force Staff is a staff with infinity power.If you can use it skillful,it

2017-08-20 10:03:26 248

原创 HDU 6152 Friend-Graph

Problem DescriptionIt is well known that small groups are not conducive of the development of a team. Therefore, there shouldn’t be any small groups in a good team. In a team with n members,if there a

2017-08-20 08:29:40 452

原创 POJ 1679 The Unique MST(次小生成树之一)

DescriptionGiven 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 is a su

2017-08-19 10:41:01 264

转载 LaTex数学公式语法

原文链接:http://lixingcong.github.io/2016/04/04/LaTex-intro/本文翻译自LaTex数学符号手册画表格示例 姓名 年龄 性别 aa bb cc AA BB CC操作符加减乘除 加 语法 减 语法 乘 语法 除 语法 + + - - ×\times \times

2017-08-18 16:11:22 5565

原创 HDU 6143 Killer Names 组合数+(容斥/第二类Stirling数)

Problem Description Galen Marek, codenamed Starkiller, was a male Human apprentice of the Sith Lord Darth Vader. A powerful Force-user who lived during the era of the Galactic Empire, Marek originate

2017-08-18 10:45:54 298

原创 POJ 1459 Power Network(网络流)

DescriptionA power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amount s(u) >= 0 of power, may produce an a

2017-08-16 21:34:06 222

原创 POJ 2777 Count Color(线段树+懒惰标记)

DescriptionChosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem. There is a very long board with length L centime

2017-08-14 20:35:17 318

原创 POJ 2828 Buy Tickets(线段树)

DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the Little Cat still

2017-08-14 15:15:48 257

原创 POJ 2558 Mayor's posters(线段树+离散化+区间更新)

DescriptionThe 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

2017-08-14 09:44:05 263

原创 POJ 1195 Mobile phones(二维树状数组)

DescriptionSuppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The squares form an S * S matrix with the rows and col

2017-08-11 17:48:05 271

原创 POJ 3321 Apple Tree(树状数组+DFS构建)

DescriptionThere is an apple tree outside of kaka’s house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.The tre

2017-08-11 15:39:43 459

原创 POJ 2503 Babelfish(STL、二分、字典树、哈希)

DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.Input

2017-08-09 20:58:41 1305

原创 HDU 6069 Counting Divisors(多校4)

Problem DescriptionIn mathematics, the function d(n) denotes the number of divisors of positive integer n.For example, d(12)=6 because 1,2,3,4,6,12 are all 12’s divisors.In this problem, given l,r and

2017-08-07 12:27:29 414

原创 HDU 6058 Kanade's sum(多校3)

Problem DescriptionGive you an array A[1..n]of length n. Let f(l,r,k) be the k-th largest element of A[l..r].Specially , f(l,r,k)=0 if r−l+1InputThere is only one integer T on first line.For each test

2017-08-06 20:57:44 225

原创 POJ 3904 Sky Code(容斥)

DescriptionStancu likes space travels but he is a poor software developer and will never be able to buy his own spacecraft. That is why he is preparing to steal the spacecraft of Petru. There is only o

2017-08-06 10:12:19 300

原创 POJ 1026 Cipher(置换)

DescriptionBob and Alice started to use a brand-new encoding scheme. Surprisingly it is not a Public Key Cryptosystem, but their encoding and decoding is based on secret keys. They chose the secret key

2017-08-04 20:52:03 286

原创 POJ 3270 Cow Sorting(置换)

DescriptionFarmer John’s N (1 ≤ N ≤ 10,000) cows are lined up to be milked in the evening. Each cow has a unique “grumpiness” level in the range 1…100,000. Since grumpy cows are more likely to damage F

2017-08-04 20:25:57 291

原创 POJ 2154 Color(polya+欧几里得)

DescriptionBeads of N colors are connected together into a circular necklace of N beads (N<=1000000000). Your job is to calculate how many different kinds of the necklace can be produced. You should kn

2017-08-04 20:01:47 294

原创 POJ 2409 Let it Bead(polya染色问题)

Description“Let it Bead” company is located upstairs at 700 Cannery Row in Monterey, CA. As you can deduce from the company name, their business is beads. Their PR department found out that customers a

2017-08-04 19:57:07 460

原创 POJ 1286 Necklace of Beads(Polya染色问题)

DescriptionBeads of red, blue or green colors are connected together into a circular necklace of n beads ( n < 24 ). If the repetitions that are produced by rotation around the center of the circular n

2017-08-04 18:56:32 408

原创 Polya定理学习总结

Burnside引理设G是N={1,2,……,n}上的置换群,G在N上可引出不同的等价类,其中不同的等价类的个数为1|G|∑g∈G\frac{1}{|G|}\sum_{g∈G}c1(g),其中,c1(g)是置换g中不边缘的个数,即g中1阶循环的个数。理解后续补更……polya定理设G={a1,a2,a3,……,ag}是n个对象的置换群,用m种颜色给这n个对象染色,不同的着色方案为:1|G|{mc(a

2017-08-04 18:44:07 688

原创 扩展欧几里得学习总结

扩展欧几里得算法用来在已知整数a,b的情况下求解符合条件的x,y值,满足等式ax+by=gcd(a,b)。 且有对于整数 a,b, 必然存在整数对 x,y,满足ax+by=gcd(a,b)。有关公式的递归关系由欧几里得算法可知求解两个整数gcd的过程,即gcd(a,b)=gcd(b,a%b)。那么当辗转到最终状态时b=0,a=gcd,此时对于ax+by=gcd(a,b)对应着x=1,y=0,即a*

2017-08-02 19:38:57 400

空空如也

空空如也

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

TA关注的人

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