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…
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.…
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…
B. Creating the Contest time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a problemset consisting of nn problems. The difficulty of the ii-th problem is aiai. It is guaranteed t…