# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
862659 | mraron | Bitaro’s Party (JOI18_bitaro) | C++14 | 2 ms | 9572 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>
using namespace std;
const int MAXN=100001;
int n,m,q;
vector<int> adj[MAXN];
vector<int> badj[MAXN];
const int blksz=0;
vector<pair<int,int>> best[MAXN];
int vis[MAXN], indeg[MAXN], volt[MAXN];
void dfs(int x) {
vis[x]=1;
for(auto& i:best[x]) i.first++;
best[x].push_back({0, x});
if(best[x].size()>blksz) best[x].resize(blksz);
for(int i:adj[x]) {
indeg[i]--;
vector<pair<int,int>> res;
res.resize(best[x].size()+best[i].size());
merge(best[i].begin(), best[i].end(), best[x].begin(), best[x].end(), res.begin(), [&](auto& x, auto& y) -> bool {
return x>y;
});
best[i].clear();
for(auto& j:res) {
if(volt[j.second]!=x) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |