K - Count the string(KMP寻找子串个数)

It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. For example: s: “a...
阅读(30) 评论(0)

J - Simpsons’ Hidden Talents (找前面的串的前缀又是后面串的后缀)

Homer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had. Marge: Yeah, what is it? Homer: Take me for example. I want to find out if I have a talent in p...
阅读(55) 评论(0)

H - Seek the Name, Seek the Fame(KMP匹配前缀+后缀)

The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same time seek the...
阅读(67) 评论(0)

G - Power Strings(KMP最小循环节出现的次数)

Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, exponentiation by a non-n...
阅读(63) 评论(0)

E - Period(KMP求循环节的位置以及出现的次数)

For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 <...
阅读(55) 评论(0)

D - Cyclic Nacklace(求可以构成循环的最少补充的字符)

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 thinking about how to...
阅读(60) 评论(0)

C - 剪花布条(KMP(出现次数无重复))

一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input 输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字符,则不再进行工作。 Output...
阅读(37) 评论(0)

B - Oulipo(KMP(有重复次数))

The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter ‘e’. He was a member of the Oulipo group. A quote from the book:Tout avait Pair normal, mais tout s’aff...
阅读(49) 评论(0)

L - Cat VS Dog(匈牙利)

include include include include include using namespace std; char a[121][121]; char b[121][121]; int g[121][121]; bool vis[121]; int linker[121]; int ans, n; bool DFS(int u)...
阅读(75) 评论(0)

K - Treasure Exploration(匈牙利+Floyd)

Have you ever read any book about treasure exploration? Have you ever see any film about treasure exploration? Have you ever explored treasure? If you never have such experiences, you would never know...
阅读(49) 评论(0)

J - Air Raid(Hopcroft-Carp)

Consider a town where all the streets are one-way and each street leads from one intersection to another. It is also known that starting from an intersection and walking through town’s streets you can...
阅读(61) 评论(0)


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 medieval...
阅读(47) 评论(0)

H - Antenna Placement(匈牙利算法+拆点+无向二分图建立)

The Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most striking reason why they got the job, is their discovery of a new,...
阅读(90) 评论(0)

G - Oil Skimming(匈牙利)

Thanks to a certain “green” resources company, there is a new profitable industry of oil skimming. There are large slicks of crude oil floating in the Gulf of Mexico just waiting to be scooped up by en...
阅读(80) 评论(0)

F - Rain on your Parade(Hopcroft-Carp)

You’re giving a party in the garden of your villa by the sea. The party is a huge success, and everyone is here. It’s a warm, sunny evening, and a soothing wind sends fresh, salty air from the sea. The...
阅读(75) 评论(0)

E - Swap(匈牙利)

Given an N*N matrix with each entry equal to 0 or 1. You can swap any two rows or any two columns. Can you find a way to make all the diagonal entries equal to 1? Input There are several test ca...
阅读(60) 评论(0)

D - 棋盘游戏(匈牙利算法)

小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。 所以现在Gardon想让小希来解决一个更难的问题,在保证尽量多的“车”的前提下,棋盘里有些格子是可以避开的,也就是说,不在这些格子上...
阅读(54) 评论(0)

A - Fire Net (dfs)

Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall.A blockhouse is a small castle that...
阅读(57) 评论(0)

T - Buy Tickets(线段树)

Railway 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 had schedu...
阅读(81) 评论(0)

I - Tunnel Warfare(线段树,区间合并)

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. Except th...
阅读(82) 评论(0)
297条 共15页1 2 3 4 5 ... 下一页 尾页
    • 访问:26554次
    • 积分:3048
    • 等级:
    • 排名:第12192名
    • 原创:293篇
    • 转载:2篇
    • 译文:2篇
    • 评论:5条