前缀后缀和搞一搞,然后枚举一下区间,找出最大值 #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];…
由于之前打过了这场比赛的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 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…
这场没打又亏疯了!!! 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…
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…