C. Maximal Intersection time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output You are given nn segments on a number line; each endpoint of every segment has integer coordinates. Some segments ca…
Codeforces Round #506 (Div. 3) E dfs+贪心 #include<bits/stdc++.h> using namespace std; typedef long long ll; ; int n,u,v; int ans; vector<int>M[maxn]; int dfs(int cur,int pre) { ; ;i<M[cur].size();i++) { int nex = M[cur][i]; if(pre == nex)con…
B. Maximal Area Quadrilateral time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral…
链接:https://codeforces.com/contest/1141/problem/B 题意: 给n个数,0代表工作,1代表休息,求能连续最大的休息长度. 可以连接首尾. 思路: 求普通连续,当第一个时间和最后一个时间都休息的时候加上去判断一下. 代码: #include <bits/stdc++.h> using namespace std; typedef long long LL; const int MAXN = 2e5; int r[MAXN]; int main() {…
D. Concatenated Multiples You are given an array aa, consisting of nn positive integers. Let's call a concatenation of numbers xx and yy the number that is obtained by writing down numbers xx and yy one right after another without changing the order.…