# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
695232 | Ahmed_Solyman | Bosses (BOI16_bosses) | C++14 | 1489 ms | 884 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;
vector<int>adj[5005];
vector<long long>s(5005);
vector<bool>vis(5005);
vector<int>g[5005];
void dfs1(int n){
queue<int>q;
q.push(n);
while(q.size()){
int x=q.front();
q.pop();
vis[x]=1;
for(auto i:adj[x]){
if(!vis[i]){
g[x].push_back(i);
vis[i]=1;
q.push(i);
}
}
}
}
long long dfs2(int n){
if(s[n]){
return s[n];
}
long long sum=1;
for(auto i:g[n]){
dfs2(i);
sum+=s[i];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |