AC自动机
AC自动机
3943: [Usaco2015 Feb]SuperBull Time Limit:10 SecMemory Limit:128 MBSubmit:300Solved:185 Description Bessie and her friends are playing hoofball in the annual Superbull championship, a...
Description Farmer John has purchased a subscription to Good Hooveskeeping magazine for his cows, so they have plenty of material to read while waiting around in the barn during milking sessions....
Description Farmer John has installed a new system of N?1 pipes to transport milk between the N stalls in his barn (2≤N≤50,000), conveniently numbered 1…N. Each pipe connects a pair of stalls, and...
Description Farmer John has purchased a subscription to Good Hooveskeeping magazine for his cows, so they have plenty of material to read while waiting around in the barn during milking sessions....
PROBLEM: (ENGLISH VERSION) Bessie and her friends are playing hoofball in the annual Superbull championship, and Farmer John is in charge of making the tournament as exciting as possible....
3942: [Usaco2015 Feb]Censoring Time Limit: 10 Sec Memory Limit: 128 MB Submit: 476 Solved: 260 [Submit][Status][Discuss] Description Farmer John has purchased a subscription to Good Hooveskee
【BZOJ4391】[Usaco2015 dec]High Card Low Card(贪心) 题面 BZOJ 题解 预处理前缀后缀的结果,中间找个地方合并就好了。 #include<iostream> #include<cstdio> #include<cstdlib> #include<...
AC自动机已经足够棒了。 但是,好像有时还是要TLE的。 一般的AC自动还是比较好,如果在某些情况下还是会被卡掉,像是这个水题 ...我看到这个题后,我清清楚楚的知道,这是个AC自动机+栈。...经过一番努力,把AC自动机...
题目 题目描述 Bessie and her sister Elsie want to travel from the barn to their favorite field, such that they leave at exactly the same time from the barn, and also arrive at exactly the same ...
农夫约翰打算重修他的农场。他有 N 块土地,连续排列成一行,标号为 1…N。在每块土地上有任意数量的草堆。他可以发出三种指令:1) 对一个连续区间的土地,每块土地增加相同数量的草堆。2) 对一个连续区间的土地,...
给定一棵有N个点的树,所有节点的权值都为0。 有K次操作,每次指定两个点s,t,将s到t路径上所有点的权值都加一。 请输出K次操作完毕后权值最大的那个点的权值。 ...很裸的一道题,树剖+查分 将val[x]+1,val[y]+1,...
3942: [Usaco2015 Feb]Censoring Time Limit:10 SecMemory Limit:128 MBSubmit:440Solved:242[Submit][Status][Discuss] Description Farmer John has purchased a subscription to Good Hooveskeepi...
传送门 坐标系上给出n个点,分”H”和”G”,一个整点坐标上至多一个点。 现在求一个不包含”G”的包含尽量多”H”的子矩形,然后在保证”H”最多的情况下还要问最小面积。 输出”H”的最大数量,和保证”H”最多时...
4390: [Usaco2015 dec]Max Flow Time Limit: 10 SecMemory Limit: 128 MBSubmit: 177Solved: 113[Submit][Status][Discuss] Description Farmer John has installed a new system of N−1 pipes to transp...
Description Bessie the cow is a huge fan of card games, which is quite surprising, given her lack of opposable thumbs. Unfortunately, none of the other cows in the herd are good opponents....
Description Farmer John has purchased a subscription to Good Hooveskeeping magazine for his cows, so they have plenty of material to read while waiting around in the barn during milking sessions....
Description Farmer John is trying to hire contractors to help rearrange his farm, but so far all of them have quit when they saw the complicated sequence of instructions FJ wanted them to follow....
USACO12月月赛银组前两题讲解(看简介) USACO12月月赛银组前两题讲解(看简介)_哔哩哔哩_bilibili USACO2021二月月赛银组讲解 USACO2021二月月赛银组讲解_哔哩哔哩_bilibili [USACO21FEB]Silver [USACO21FEB]...
BFS
4397: [Usaco2015 dec]Breed Counting 【题目描述】 传送门 【题解】 简单的hash。 代码如下 #include<cstdio> using namespace std; int n,m,hsh[100005][5]; int main(){ #ifndef ONLINE_JUDGE ....
SuperBull bzoj-3943 Usaco-2015 Feb 题目大意:贝西和她的朋友们在参加一年一度的“犇”(足)球锦标赛。FJ的任务是让这场锦标赛尽可能地好看。一共有N支球队参加这场比赛,每支球队都有一个特有的取值在1-230-1之间...
题目描述 In an effort to better manage the grazing patterns of his cows, Farmer John has installed one-way cow paths all over his farm. The farm consists of N fields, conveniently numbered 1..N, ...
由于这套题某两题重复了3次,我就只好放在一起写了Cow Hopscotch这道题Bronze,Silver,Gold各有一道,难度依次增加。对于Bronze的,颜色只有两种,r和c,O(n4)O(n^4)跑一发dp即可(比noiopenjudge的dp还简单==)对于...
3942: [Usaco2015 Feb]Censoring Time Limit:10 SecMemory Limit:128 MBSubmit:404Solved:221[Submit][Status][Discuss] Description Farmer John has purchased a subscription to Good Hooves...
AC自动机。为什么洛谷水题赛会出现这种题然而并不会那么题意就不说啦。终于会写AC自动机判断是否是子串啦。。。用到kmp的就可以用AC自动机水过去啦 #include<cstdio> #include<...queue>...
4390: [Usaco2015 dec]Max Flow Time Limit: 10 Sec Memory Limit: 128 MB Submit: 228 Solved: 143 [Submit][Status][Discuss] Description Farmer John has installed a new system of N−1 pipes to tran
【传送门:BZOJ4390】 简要题意: 给出一棵n个点的树,一开始所有点的点权为0,给出k个操作,每个操作输入x,y,表示将x到y的路径上的点权全部+1 求出最大点权 ... 对于一个操作x,y,lca表示x和y的最近公共...
题目大意: 坐标系上给出n个点,分”H”和”G”,一个整点坐标上至多一个点。 现在求一个不包含”G”的包含尽量多”H”的子矩形,然后在保证”H”最多的情况下还要问最小面积。 输出”H”的最大数量,和保证”H”...