要点 因为当前最大字符只有一个且两边是回文的,所以如果答案包含最大字符则一定是重合部分. 若不包含,则用此字符将两个区间分别断为两部分,则共有四种组合,答案一定为其中之一. #include <cstdio> #include <algorithm> using namespace std; int l1, l2, r1, r2; int Divide(int a, int b, int c, int d, int depth) { if (a > b || c > d…
队友和大佬都什么几种情况啥的……我是把终点都插了,起点随便选一个,暴举答案莽A. ; ll n, k, a, b, aa, minn = INF, maxx = -; set<ll> bb; ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } int main() { cin >> n >> k >> a >> b; ll T = n * k; rep(i, , n - ) { ll p =…
http://codeforces.com/contest/322/problem/E E. Ciel the Commander time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Now Fox Ciel becomes a commander of Tree Land. Tree Land, like its name sai…