题意比较麻烦略 题解:枚举前缀的中点,二分最远能扩展的地方,lcp来check,然后线段树维护每个点最远被覆盖的地方,然后查询线段树即可 //#pragma GCC optimize(2) //#pragma GCC optimize(3) //#pragma GCC optimize(4) //#pragma GCC optimize("unroll-loops") //#pragma comment(linker, "/stack:200000000") //#…
由于之前打过了这场比赛的E题,而后面两道题太难,所以就手速半个多小时A了前4题. 就当练手速吧,不过今天除了C题数组开小了以外都是1A A Tetris 题意的抽象解释可以在Luogu里看一下(话说现在Luogu是真的好用) 非常入门的一道题,建模转化后扫一遍找出最小值即可 CODE #include<cstdio> #include<cstring> using namespace std; const int N=1005; int a[N],n,m,x,ans; inline…
这场没打又亏疯了!!! A - Tetris : 类似俄罗斯方块,模拟一下就好啦. #include<bits/stdc++.h> #define fi first #define se second #define mk make_pair #define pii pair<int,int> using namespace std; typedef long long ll; const int inf=0x3f3f3f3f; const ll INF=0x3f3f3f3f3f3…
最近打的比较少...就只有这么点题解了. A. Tetris time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a following process. There is a platform with n columns. 1 × 1 squares are appearing one after a…
#include <vector> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; ; ll x[N], y[N]; int n; bool gx(int a, int b, int c, int d) { return (x[b] - x[a])*(y[d] - y[c]) == (x[d] - x[c])*(y[b] - y[a]); } int…
//暴力 #include <iostream> #include <algorithm> #include <string> using namespace std; ; string s1[N], s2[N], s3[N], s4[N]; int a[N][N], b[N][N]; int main() { int n; cin >> n; ; i<n; i++) cin >> s1[i]; cin.get(); ; i<n; i…
前缀后缀和搞一搞,然后枚举一下区间,找出最大值 #include <iostream> #include <algorithm> using namespace std; ; int a[maxn], f[maxn], b[maxn], c[maxn]; int main() { ios::sync_with_stdio(false); int n, k; cin >> n >> k; ; i <= n; i++) cin >> a[i];…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 如果点的个数<=3 那么直接输出有解. 否则. 假设1,2最后会在一条直线上,则把这条直线上的点都删掉. 看看剩余的点是否在同一条直线上,是的话输出有解. 否则再假设1,3最后会在一条直线上,同样的看看这条直线之外的点是否 在同一条直线上. 是的话同样输出有解. 否则,因为前两种都没有解,那就说明1和2不共线,且1和3不共线,而只有两条线,且要穿过所有点. 那么就说明2,3肯定是只能在一条线上了,然后1分另外一条线. 把2,3用…
D. Pair Of Lines time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given n points on Cartesian plane. Every point is a lattice point (i. e. both of its coordinates are integers), and…
Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec Problem Description Input Output The only line should contain the minimal number of days required for the ship to reach the point (x2,y2)(x2,y2). If it…