自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

WZJRJ28

为了看到更大的世界

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

原创 Codeforces Round #353 (Div. 2) E. Trains and Statistic

Vasya commutes by train every day. There are n train stations in the city, and at the i-th station it's possible to buy only tickets to stations from i + 1 to ai inclusive. No tickets are sold at th

2016-05-31 16:02:11 472

原创 Hdu-5335 Walk Out (BFS+贪心)

Problem Description In an n∗m maze(迷失), the right-bottom corner is the exit (position (n,m) is the exit). In every position of this maze, there is either a 0 or a 1 written on it. An exp

2016-05-30 17:04:56 411

原创 Hdu-5344 MZL's xor

Problem Description MZL loves xor very much.Now he gets an array A.The length of A is n.He wants to know the xor of all (Ai+Aj)(1≤i,j≤n) The xor of an array B is defined as B1 xor B2...xor Bn  

2016-05-29 17:54:47 362

原创 Hdu-5289 Assignment (二分+RMQ || 单调队列)

Problem Description Tom owns a company and he is the boss. There are n staffs which are numbered from 1 to n in this company, and every staff has a ability. Now, Tom is going to assign a special task

2016-05-29 10:51:49 368

原创 Hdu-5301 Buildings(思维题)

Problem Description Your current task is to make a ground plan for a residential building located in HZXJHS. So you must determine a way to split the floor building with walls to make apartments in t

2016-05-29 10:44:49 443

原创 Hdu-5328 Problem Killer

Problem Description You are a "Problem Killer", you want to solve many problems. Now you have n problems, the i-th problem's difficulty is represented by an integer ai (1≤ai≤109). For som

2016-05-28 20:15:17 466

原创 Codeforces Round #354 (Div. 2) D. Theseus and labyrinth (BFS)

Theseus has just arrived to Crete to fight Minotaur. He found a labyrinth that has a form of a rectangular field of size n × m and consists of blocks of size 1 × 1. Each block of the labyrinth has

2016-05-26 20:47:14 492

原创 POJ-2778 DNA Sequence(AC自动机+矩阵快速幂)

Description It's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For example, if a animal's DNA sequence contains seg

2016-05-25 11:57:49 349

原创 Uva 11019 Matrix Matcher(二维字符串匹配)

题意:给出一个n*m的字符矩阵T,你的任务是找出给定的x*y的字符矩阵P在T中出现了多少次. 分析:白书原题,先把P构造成一个AC自动机,然后在T中逐行匹配。用一个数组记录以一个点为左上角能匹配到P的多少行。 #include #include #include #include #include #define MAXNODE 10005 using names

2016-05-24 15:35:00 616

原创 Codeforces Round #298 (Div. 2) D. Handshakes

On February, 30th n students came in the Center for Training Olympiad Programmers (CTOP) of the Berland State University. They came one by one, one after another. Each of them went in, and before sitt

2016-05-24 10:19:51 373

原创 Uva 11468 Substring (AC自动机)

题意:给出一些字符和各自对应的选择概率,随机选择L次后将得到一个长度为L的随机字符串S.给出K个模版串,计算S不包含任何一个串的概率. 分析:构造好AC自动机后,直接在树上进行DP,dp[i[l]表示当前在i点还要匹配l长度的概率。(PS 这题精度判断好坑啊,之前保留10位疯狂WA....) #include #include #include #include #de

2016-05-23 21:13:07 413

原创 Hdu-2222 Keywords Search(AC自动机)

Problem Description In 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 retrieval(检索) system.

2016-05-23 17:00:29 501

原创 8VC Venture Cup 2016 - Elimination Round C. Block Towers

Students in a class are making towers of blocks. Each student makes a (non-zero) tower by stacking pieces lengthwise on top of each other. n of the students use pieces made of two blocks and m of th

2016-05-22 22:28:29 452

原创 Educational Codeforces Round 12 E. Beautiful Subarrays

One day, ZS the Coder wrote down an array of integers a with elements a1,  a2,  ...,  an. A subarray of the array a is a sequence al,  al  +  1,  ...,  ar for some integers (l,  r) such that 1  

2016-05-21 22:31:39 559

原创 Educational Codeforces Round 11 D. Number of Parallelograms

You are given n points on a plane. All the points are distinct and no three of them lie on the same line. Find the number of parallelograms with the vertices at the given points. Input The first

2016-05-21 22:16:46 518

原创 Educational Codeforces Round 12 D. Simple Subset

A tuple of positive integers {x1, x2, ..., xk} is called simple if for all pairs of positive integers (i,  j) (1  ≤ i  j ≤ k), xi  +  xj is a prime. You are given an array a with n positive integ

2016-05-21 22:09:41 352

原创 Codeforces Round #189 (Div. 1) B. Psychos in a Line

There are n psychos standing in a line. Each psycho(心理分析) is assigned(分配) a unique(独特的) integer(整数) from 1 to n. At each step every psycho who has an id greater than the psycho to his right (if e

2016-05-20 15:38:57 689

原创 Codeforces Round #144 (Div. 1) A. Cycles

John Doe started thinking about graphs. After some thought he decided that he wants to paint an undirected graph, containing exactly k cycles of length 3. A cycle of length 3 is an unordered grou

2016-05-19 19:37:06 312

原创 Hdu-4763 Theme Section

Problem Description It's time for music! A lot of popular musicians are invited to join us in the music festival. Each of them will play one of their representative songs. To make the programs more i

2016-05-19 15:15:29 410

原创 Hdu-4749 Parade Show

Description   2013 is the 60 anniversary of Nanjing University of Science and Technology, and today happens to be the anniversary date. On this happy festival, school authority hopes that the

2016-05-19 11:07:36 424

原创 Hdu-3746 Cyclic Nacklace

Problem Description CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and

2016-05-18 16:47:26 320

原创 BZOJ-3670: [Noi2014]动物园

Description 近日,园长发现动物园中好吃懒做的动物越来越多了。例如企鹅,只会卖萌向游客要吃的。为了整治动物园的不良风气,让动物们凭自己的真才实学向游客要吃的,园长决定开设算法班,让动物们学习算法。 某天,园长给动物们讲解KMP算法。 园长:“对于一个字符串S,它的长度为L。我们可以在O(L)的时间内,求出一个名为next的数组。有谁预习了next数组的含义吗?” 熊猫:“对于

2016-05-18 16:17:59 355

原创 Hdu-2087 剪花布条

Description 一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?   Input 输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个

2016-05-17 19:35:20 380

原创 Codeforces Round #353 (Div. 2) D. Tree Construction

During the programming classes Vasya was assigned a difficult problem. However, he doesn't know how to code and was unable to find the solution in the Internet, so he asks you to help. You are given

2016-05-17 17:16:30 699

原创 Codeforces Round #353 (Div. 2) C. Money Transfers

There are n banks in the city where Vasya lives, they are located in a circle, such that any two banks are neighbouring if their indices differ by no more than 1. Also, bank 1 and bank n are neighbo

2016-05-17 16:22:14 597

原创 Codeforces Round #353 (Div. 2) B. Restoring Painting

Vasya works as a watchman in the gallery. Unfortunately, one of the most expensive paintings was stolen while he was on duty. He doesn't want to be fired, so he has to quickly restore the painting. He

2016-05-17 14:16:34 442

原创 Hdu-1867 A + B for you again

A + B for you again Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 6027    Accepted Submission(s): 1493 Problem Description Generally

2016-05-16 19:44:24 361

原创 Hdu-3336 Count the string(KMP + DP)

Count the string Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7697    Accepted Submission(s): 3581 Problem Description It is well kn

2016-05-16 15:48:23 411

原创 Codeforces Round #246 (Div. 2) D. Prefixes and Suffixes

You have a string s = s1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1 ≤ i ≤ j ≤ |s|) of string s i

2016-05-16 15:01:40 636

原创 LA-3942 Remember the Word

题意:给出一个由S个不同的单词组成的字典和一个长字符串,把这个字符串分解成若干个单词的连接单词可以重复使用,有多少种方法?(PS 应该%20071027,白书写错了) 分析:dp + trie tree. #include #include #include #define maxnode 400001 #define MAXN 20071027 using namesp

2016-05-15 22:04:10 355

原创 CodeForces 629C Famil Door and Brackets

As Famil Door’s birthday is coming, some of his friends (like Gabi) decided to buy a present for him. His friends are going to buy a string consisted of round brackets since Famil Door loves string of

2016-05-15 18:05:46 370

原创 Codeforces Round #246 (Div. 2) C. Prime Swaps

You have an array a[1], a[2], ..., a[n], containing distinct integers from 1 to n. Your task is to sort this array in increasing order with the following operation (you may need to apply it multiple

2016-05-14 19:54:37 347

原创 Codeforces Round #347 (Div. 1) B. International Olympiad

International Abbreviation Olympiad takes place annually starting from 1989. Each year the competition receives an abbreviation of form IAO'y, where y stands for some number of consequent last digits

2016-05-14 17:16:16 317

原创 DOJ - 1005 City Horizon (线段树扫面线)

问题描述 Farmer John has taken his cows on a trip to the city! As the sun sets, the cows gaze at the city horizon and observe the beautiful silhouettes formed by the rectangular buildings. The entire

2016-05-14 15:40:43 361

原创 DOJ - 1002 Least Subsequence

问题描述Giving a set of keywords like (key1,key2,…,keym)(key1,key2,…,keym) and a paragraph like (word1,word2,…,wordn)(word1,word2,…,wordn), please find the least subsequence of the paragraph which includes

2016-05-14 12:56:32 1256

原创 Codeforces Round #347 (Div. 2) B. Rebus

You are given a rebus of form ? + ? - ? + ? = n, consisting of only question marks, separated by arithmetic operation '+' and '-', equality and positive integer n. The goal is to replace each questi

2016-05-14 00:03:00 509

原创 Codeforces Round #352 (Div. 1) B. Robin Hood

We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor. There are n citizens in Kekoland, each person

2016-05-12 23:29:35 568

原创 Codeforces Round #352 (Div. 1) A. Recycling Bottles

It was recycling day in Kekoland. To celebrate it Adil and Bera went to Central Perk where they can take bottles from the ground and put them into a recycling bin. We can think Central Perk as coordi

2016-05-12 22:55:42 321

原创 Codeforces Round #332 (Div. 2) D. Spongebob and Squares

Spongebob is already tired trying to reason his weird actions and calculations, so he simply asked you to find all pairs of n and m, such that there are exactly x distinct squares in the table consis

2016-05-11 10:01:24 808

原创 Codeforces Round #283 (Div. 2) D. Tennis Game

Petya and Gena love playing table tennis. A single match is played according to the following rules: a match consists of multiple sets, each set consists of multiple serves. Each serve is won by one o

2016-05-10 23:59:10 820

空空如也

空空如也

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

TA关注的人

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