题目描述 The cows enjoy mooing at the barn because their moos echo back, although sometimes not completely. Bessie, ever the excellent secretary, has been recording the exact wording of the moo as it goes out and returns. She is curious as to just how mu…
https://www.luogu.org/problem/show?pid=2957 题目描述 The cows enjoy mooing at the barn because their moos echo back, although sometimes not completely. Bessie, ever the excellent secretary, has been recording the exact wording of the moo as it goes out a…
https://www.luogu.org/problem/P2957 题目描述 The cows enjoy mooing at the barn because their moos echo back, although sometimes not completely. Bessie, ever the excellent secretary, has been recording the exact wording of the moo as it goes out and retur…
传送门 团队里的hash水题,数据小的不用hash都能过.. 也就是前缀hash,后缀hash,再比较一下就行. ——代码 #include <cstdio> #include <cstring> #define ULL unsigned long long int n, m, ans; ], s2[]; ULL ], sum1[], sum2[], bit1[], bit2[]; inline int max(int x, int y) { return x > y ? x…
3409: [Usaco2009 Oct]Barn Echoes 牛棚回声 Time Limit: 3 Sec  Memory Limit: 128 MBSubmit: 57  Solved: 47[Submit][Status][Discuss] Description 奶牛们灰常享受在牛栏中哞叫,因为她们可以听到她们哞声的回音.虽然有时候并不能完全听到完整的回音.Bessie曾经是一个出色的秘书,所以她精确地纪录了所有的哞叫声及其回声.她很好奇到底两个声音的重复部份有多长. 输入两个字符串(…
题目描述 Farmer John is building a brand new, NNN -story barn, with the help of his KKK cows ( 1≤N≤K≤10121 \leq N \leq K \leq 10^{12}1≤N≤K≤1012 and N≤105N \leq 10^5N≤105 ). To build it as quickly as possible, he needs your help to figure out how to alloc…
传送门 把线段都读进来然后排序,先按右端点为第一关键字从小到大排序,后按左端点为第二关键字从小到大排序. 注意不能先按左端点后按右端点排序,否则会出现大包小的情况,如下: —————— ———  — 然后直接线段树搞就行,先求区间最小值,如果大于零就更新统一减1. ——代码 #include <cstdio> #include <iostream> #include <algorithm> #define root 1, 1, n #define ls now <…
题目描述It's milking time at Farmer John's farm, but the cows have all run away! Farmer John needs to round them all up, and needs your help in the search. FJ's farm is a series of N (1 <= N <= 200,000) pastures numbered 1...N connected by N - 1 bidirec…
题目传送门 逃跑的Barn 题目描述 It's milking time at Farmer John's farm, but the cows have all run away! Farmer John needs to round them all up, and needs your help in the search. FJ's farm is a series of N (1 <= N <= 200,000) pastures numbered 1...N connected b…
题目传送门 解题思路: 二维差分的板子题.题解传送门 AC代码: #include<iostream> #include<cstdio> using namespace std; ][],ans,a[][]; int main() { scanf("%d%d",&n,&k); ;i <= n; i++) { int x,y,xx,yy; scanf("%d%d%d%d",&x,&y,&xx,&am…