# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
779738 | Sandarach151 | Bosses (BOI16_bosses) | C++17 | 1 ms | 324 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;
void dfs(int cur, vector<int> adgtree[], int salary[]){
if(adgtree[cur].empty()){
salary[cur]=1;
}
else{
int cnt = 0;
for(int next : adgtree[cur]){
dfs(next, adgtree, salary);
cnt+=salary[next];
}
salary[cur]=cnt+1;
}
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<int> adg[n];
for(int i=0; i<n; i++){
int a;
cin >> a;
for(int j=0; j<a; j++){
int b;
cin >> b;
adg[b-1].push_back(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... |