# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1150481 | bilgun | Newspapers (CEOI21_newspapers) | C++20 | 1093 ms | 328 KiB |
#include<bits/stdc++.h>
using namespace std;
long long n, m, sum = 0;
vector<vector<long long>> g;
int par[1005], h[1005], path[1005];
int yno = 0;
vector<int> ans;
pair<int, int> dfs( int node, int parent) {
int maxd = 0;
int distm = node;
for( auto it : g[node]) {
if(it != parent) {
par[it] = node;
auto s = dfs(it, node);
s.first++;
if( s.first > maxd) {
maxd = s.first;
distm = s.second;
}
}
}
return {maxd, distm};
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |