# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
953153 | Unforgettablepl | Fireworks (APIO16_fireworks) | C++17 | 2052 ms | 106280 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include <utility>
using namespace std;
#define int long long
struct line{
int m,n;
vector<int> points;
line(int m,int n,vector<int> points):m(m),n(n),points(points){}
void operator+=(const line &other){
m+=other.m;
n+=other.n;
vector<int> newpoints(points.size()+other.points.size());
merge(points.begin(), points.end(),other.points.begin(), other.points.end(),newpoints.begin());
points = newpoints;
}
};
int n,m;
vector<pair<int,int>> adj[300001];
line dfs(int x,int p){
if(x>n)return {1,-adj[x][0].second,{adj[x][0].second,adj[x][0].second}};
int len = 0;
line curr(0,0,{});
for(auto&i:adj[x]){
if(i.first!=p)curr+=dfs(i.first,x);
else len = i.second;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |